Remove usage of error
This commit is contained in:
parent
4d1044bc16
commit
49be2bc1ae
1 changed files with 12 additions and 5 deletions
|
|
@ -291,10 +291,13 @@ To specify values for the labels, pass an alist as
|
|||
values are the values."
|
||||
(unless (memq (metric-type metric)
|
||||
'(counter gauge))
|
||||
(error "can only increment counter and gauge metrics"))
|
||||
(raise-exception
|
||||
(make-exception-with-message
|
||||
"can only increment counter and gauge metrics")))
|
||||
|
||||
(unless (positive? by)
|
||||
(error "can only increment positive values"))
|
||||
(raise-exception
|
||||
(make-exception-with-message "can only increment positive values")))
|
||||
|
||||
(let ((canonical-labels
|
||||
(canonicalise-label-values label-values))
|
||||
|
|
@ -322,7 +325,8 @@ To specify values for the labels, pass an alist as
|
|||
values are the values."
|
||||
(unless (memq (metric-type metric)
|
||||
'(gauge))
|
||||
(error "can only increment gauge metrics"))
|
||||
(raise-exception
|
||||
(make-exception-with-message "can only increment gauge metrics")))
|
||||
|
||||
(let ((canonical-labels
|
||||
(canonicalise-label-values label-values))
|
||||
|
|
@ -348,7 +352,8 @@ To specify values for the labels, pass an alist as
|
|||
values are the values."
|
||||
(unless (memq (metric-type metric)
|
||||
'(gauge))
|
||||
(error "can only set gauge metrics"))
|
||||
(raise-exception
|
||||
(make-exception-with-message "can only set gauge metrics")))
|
||||
|
||||
(unless (number? value)
|
||||
(raise-exception
|
||||
|
|
@ -374,7 +379,9 @@ To specify values for the labels, pass an alist as
|
|||
values are the values."
|
||||
|
||||
(unless (histogram-metric-type? (metric-type metric))
|
||||
(error "can only observe histogram metrics"))
|
||||
(raise-exception
|
||||
(make-exception-with-message
|
||||
"can only observe histogram metrics")))
|
||||
|
||||
(let ((canonical-labels
|
||||
(canonicalise-label-values label-values))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue