@@ -89,9 +89,11 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | return $builder->samples(); |
| 92 | - } catch (LabelException $e) { |
|
| 92 | + } |
|
| 93 | + catch (LabelException $e) { |
|
| 93 | 94 | throw $e; |
| 94 | - } catch (Exception $e) { |
|
| 95 | + } |
|
| 96 | + catch (Exception $e) { |
|
| 95 | 97 | $class = get_class($metric); |
| 96 | 98 | |
| 97 | 99 | throw new StorageException("Failed to collect the samples of [{$class}]: {$e->getMessage()}", 0, $e); |
@@ -109,9 +111,11 @@ discard block |
||
| 109 | 111 | $this->labeled($metric, $labels)->toJson(), |
| 110 | 112 | $value |
| 111 | 113 | ); |
| 112 | - } catch (LabelException $e) { |
|
| 114 | + } |
|
| 115 | + catch (LabelException $e) { |
|
| 113 | 116 | throw $e; |
| 114 | - } catch (Exception $e) { |
|
| 117 | + } |
|
| 118 | + catch (Exception $e) { |
|
| 115 | 119 | $class = get_class($metric); |
| 116 | 120 | |
| 117 | 121 | throw new StorageException("Failed to increment [{$class}] by `{$value}`: {$e->getMessage()}", 0, $e); |
@@ -129,9 +133,11 @@ discard block |
||
| 129 | 133 | $this->labeled($metric, $labels)->toJson(), |
| 130 | 134 | $value |
| 131 | 135 | ); |
| 132 | - } catch (LabelException $e) { |
|
| 136 | + } |
|
| 137 | + catch (LabelException $e) { |
|
| 133 | 138 | throw $e; |
| 134 | - } catch (Exception $e) { |
|
| 139 | + } |
|
| 140 | + catch (Exception $e) { |
|
| 135 | 141 | $class = get_class($metric); |
| 136 | 142 | |
| 137 | 143 | throw new StorageException("Failed to decrement [{$class}] by `{$value}`: {$e->getMessage()}", 0, $e); |
@@ -146,9 +152,11 @@ discard block |
||
| 146 | 152 | try { |
| 147 | 153 | $this->binding(self::OBSERVER_BINDING_KEY, $metric) |
| 148 | 154 | ($metric, $this->labeled($metric, $labels), $value); |
| 149 | - } catch (LabelException $e) { |
|
| 155 | + } |
|
| 156 | + catch (LabelException $e) { |
|
| 150 | 157 | throw $e; |
| 151 | - } catch (Exception $e) { |
|
| 158 | + } |
|
| 159 | + catch (Exception $e) { |
|
| 152 | 160 | $class = get_class($metric); |
| 153 | 161 | |
| 154 | 162 | throw new StorageException("Failed to observe [{$class}] with `{$value}`: {$e->getMessage()}", 0, $e); |
@@ -166,9 +174,11 @@ discard block |
||
| 166 | 174 | $this->labeled($metric, $labels)->toJson(), |
| 167 | 175 | $value |
| 168 | 176 | ); |
| 169 | - } catch (LabelException $e) { |
|
| 177 | + } |
|
| 178 | + catch (LabelException $e) { |
|
| 170 | 179 | throw $e; |
| 171 | - } catch (Exception $e) { |
|
| 180 | + } |
|
| 181 | + catch (Exception $e) { |
|
| 172 | 182 | $class = get_class($metric); |
| 173 | 183 | |
| 174 | 184 | throw new StorageException("Failed to set [{$class}] to `{$value}`: {$e->getMessage()}", 0, $e); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $actual = count($labels); |
| 23 | 23 | |
| 24 | 24 | if ($expected !== $actual) { |
| 25 | - throw new LabelException("Expected {$expected} label values but {$actual} were given."); |
|
| 25 | + throw new LabelException("expected {$expected} label values but {$actual} were given."); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | // FIXME: Only return the value. |