Skip to content

Commit

Permalink
Check if the exception code is an integer
Browse files Browse the repository at this point in the history
  • Loading branch information
tylercd100 committed Apr 1, 2016
1 parent 124bbcd commit 0c44fd2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to `LERN` will be documented in this file.

### 3.1.4
- Check if the exception code is an integer

### 3.1.3
- Use Attribute Casting in Exception Model

Expand Down
3 changes: 2 additions & 1 deletion src/Components/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ public function send(Exception $e, array $context = []) {

return true;
} catch (Exception $e) {
throw new NotifierFailedException($e->getMessage(), $e->getCode(), $e);
$code = (is_int($e->getCode()) ? $e->getCode() : 0);
throw new NotifierFailedException($e->getMessage(), $code, $e);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/Components/Recorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public function record(Exception $e)

return ExceptionModel::create($opts);
} catch (Exception $e) {
throw new RecorderFailedException($e->getMessage(), $e->getCode(), $e);
$code = (is_int($e->getCode()) ? $e->getCode() : 0);
throw new RecorderFailedException($e->getMessage(), $code, $e);
}
}

Expand Down

0 comments on commit 0c44fd2

Please sign in to comment.