-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from michielkempen/master
Add fallback to SerializableException to handle "complex" exceptions
- Loading branch information
Showing
5 changed files
with
113 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Spatie\Async\Output; | ||
|
||
class ParallelException extends \Exception | ||
{ | ||
/** @var string */ | ||
protected $originalClass; | ||
|
||
/** @var string */ | ||
protected $originalTrace; | ||
|
||
public function __construct(string $message, string $originalClass, string $originalTrace) | ||
{ | ||
parent::__construct($message); | ||
$this->originalClass = $originalClass; | ||
$this->originalTrace = $originalTrace; | ||
} | ||
|
||
/** @return string */ | ||
public function getOriginalClass(): string | ||
{ | ||
return $this->originalClass; | ||
} | ||
|
||
/** @return string */ | ||
public function getOriginalTrace(): string | ||
{ | ||
return $this->originalTrace; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Spatie\Async\Tests; | ||
|
||
use Exception; | ||
use stdClass; | ||
|
||
class MyExceptionWithAComplexArgument extends Exception | ||
{ | ||
public $payload; | ||
|
||
public function __construct(string $message, stdClass $payload) | ||
{ | ||
parent::__construct($message); | ||
$this->payload = $payload; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Spatie\Async\Tests; | ||
|
||
use Exception; | ||
use stdClass; | ||
|
||
class MyExceptionWithAComplexFirstArgument extends Exception | ||
{ | ||
public $payload; | ||
|
||
public function __construct(stdClass $payload, string $message) | ||
{ | ||
parent::__construct($message); | ||
$this->payload = $payload; | ||
} | ||
} |