diff --git a/src/Socialbox/Exceptions/StandardException.php b/src/Socialbox/Exceptions/StandardException.php index f9f639c..8028440 100644 --- a/src/Socialbox/Exceptions/StandardException.php +++ b/src/Socialbox/Exceptions/StandardException.php @@ -3,6 +3,8 @@ namespace Socialbox\Exceptions; use Exception; + use Socialbox\Classes\Configuration; + use Socialbox\Classes\Utilities; use Socialbox\Enums\StandardError; use Socialbox\Objects\RpcError; use Socialbox\Objects\RpcRequest; @@ -29,6 +31,11 @@ public function produceError(RpcRequest $request): ?RpcError { + if(Configuration::getSecurityConfiguration()->isDisplayInternalExceptions()) + { + return $request->produceError(StandardError::from($this->code), Utilities::throwableToString($this)); + } + return $request->produceError(StandardError::from($this->code), $this->message); } } \ No newline at end of file