invoiceninja/app/Exceptions/NordigenApiException.php
2023-11-30 16:00:50 +01:00

42 lines
761 B
PHP

<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class NordigenApiException extends Exception
{
/**
* Report the exception.
*
* @return void
*/
public function report()
{
//
}
/**
* Render the exception into an HTTP response.
*
* @param Request $request
* @return Response
*/
public function render($request)
{
// $msg = 'Unable to refund the transaction';
$msg = ctrans('texts.error');
if ($this->getMessage() && strlen($this->getMessage()) >= 1) {
$msg = $this->getMessage();
}
return response()->json([
'message' => $msg,
], 400);
}
}