Skip to content

Commit

Permalink
Improved logged error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Oct 5, 2023
1 parent 55305d4 commit 1675f0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Client/JsonApi/Base.php
Expand Up @@ -207,7 +207,7 @@ protected function getErrorDetails( \Exception $e, string $domain = null ) : arr
$details['title'] = $this->context->translate( $domain, $e->getMessage() );
} else {
$details['title'] = $this->context->translate( 'admin', 'An error occured and has been added to the logs' );
$this->context->logger()->log( $e->getTraceAsString() . PHP_EOL . $e->getMessage() );
$this->context->logger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );
}

/** client/jsonapi/debug
Expand All @@ -225,8 +225,8 @@ protected function getErrorDetails( \Exception $e, string $domain = null ) : arr
*/
if( $this->context->config()->get( 'client/jsonapi/debug', false ) == true )
{
$details['detail'] = $e->getTraceAsString();
$details['title'] = $e->getMessage();
$details['detail'] = $e->getTraceAsString();
}

return [$details]; // jsonapi.org requires a list of error objects
Expand Down

0 comments on commit 1675f0f

Please sign in to comment.