Skip to content

Commit

Permalink
chore: Add debug full stack trace message
Browse files Browse the repository at this point in the history
  • Loading branch information
bingo-soft committed Sep 7, 2023
1 parent 1db9833 commit e7f58df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/Impl/Interceptor/CommandInvocationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,16 @@ protected function getTargetProcessApplication(ExecutionEntity $execution): ?Pro
public function rethrow(): void
{
if ($this->throwable !== null) {
fwrite(STDERR, sprintf("exception while executing command: %s", $this->throwable->getMessage()) . "\n");
throw new ProcessEngineException(sprintf("exception while executing command: %s", $this->throwable->getMessage()), $this->throwable);
$errorStack = [];
for ($i = 0; $i < 50; $i += 1) {
try {
$t = $this->throwable->getTrace()[$i];
$errorStack[] = sprintf("%s.%s.%s", $t['file'], $t['function'], $t['line']);
} catch (\Throwable $tt) {
}
}
fwrite(STDERR, sprintf("exception while executing command: %s", implode(' <= ', $errorStack)) . "\n"); //$this->throwable->getMessage()
throw new ProcessEngineException(sprintf("exception while executing command: %s", implode(' <= ', $errorStack)), $this->throwable);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Impl/Util/ExceptionUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public static function doWithExceptionWrapper(callable $supplier)
public static function wrapPersistenceException(\Throwable $ex): ProcessEngineException
{
$from = [];
for ($i = 0; $i < 30; $i += 1) {
for ($i = 0; $i < 50; $i += 1) {
try {
$t = $ex->getTrace()[$i];
$from[] = sprintf("%s.%s.%s", $t['file'], $t['function'], $t['line']);
Expand Down

0 comments on commit e7f58df

Please sign in to comment.