Skip to content

Commit

Permalink
Merge pull request #12 from NauxLiu/patch-1
Browse files Browse the repository at this point in the history
Add exception class name to failed message
  • Loading branch information
nathanielks authored Jun 26, 2017
2 parents 40b4bdc + 88ade62 commit 3862961
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/monitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function cronitorMonitorTask($client, $closure, $exceptionHandler = false)
$pause = false;

if (!$exceptionHandler) {
$msg = $e->getMessage();
$msg = get_class($e) . " with message '" . $e->getMessage() . "'";
} else {
// $exceptionHandler should return an array like the following:
// array(
Expand Down
3 changes: 1 addition & 2 deletions tests/MonitorTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

class MonitorTaskTest extends TestBase
{

public function test_it_should_return_value_on_success()
{
$client = $this->getOkClient();
Expand Down Expand Up @@ -51,7 +50,7 @@ public function test_it_should_send_exceptions_message_on_failure()

$client->expects($this->once())
->method('fail')
->with($msg);
->with("Exception with message '{$msg}'");

cronitorMonitorTask(
$client,
Expand Down

0 comments on commit 3862961

Please sign in to comment.