mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Add more details in message.
This commit is contained in:
parent
c32044a8eb
commit
1ba7847d84
@ -128,7 +128,7 @@ class Handler extends ExceptionHandler
|
|||||||
$errorCode = 500;
|
$errorCode = 500;
|
||||||
$errorCode = $e instanceof MethodNotAllowedHttpException ? 405 : $errorCode;
|
$errorCode = $e instanceof MethodNotAllowedHttpException ? 405 : $errorCode;
|
||||||
|
|
||||||
$isDebug = (bool) config('app.debug', false);
|
$isDebug = (bool) config('app.debug', false);
|
||||||
if ($isDebug) {
|
if ($isDebug) {
|
||||||
app('log')->debug(sprintf('Return JSON %s with debug.', get_class($e)));
|
app('log')->debug(sprintf('Return JSON %s with debug.', get_class($e)));
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ class Handler extends ExceptionHandler
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$userData = [
|
$userData = [
|
||||||
'id' => 0,
|
'id' => 0,
|
||||||
'email' => 'unknown@example.com',
|
'email' => 'unknown@example.com',
|
||||||
];
|
];
|
||||||
@ -200,9 +200,9 @@ class Handler extends ExceptionHandler
|
|||||||
$userData['email'] = auth()->user()->email;
|
$userData['email'] = auth()->user()->email;
|
||||||
}
|
}
|
||||||
|
|
||||||
$headers = request()->headers->all();
|
$headers = request()->headers->all();
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'class' => get_class($e),
|
'class' => get_class($e),
|
||||||
'errorMessage' => $e->getMessage(),
|
'errorMessage' => $e->getMessage(),
|
||||||
'time' => date('r'),
|
'time' => date('r'),
|
||||||
@ -216,11 +216,12 @@ class Handler extends ExceptionHandler
|
|||||||
'json' => request()->acceptsJson(),
|
'json' => request()->acceptsJson(),
|
||||||
'method' => request()->method(),
|
'method' => request()->method(),
|
||||||
'headers' => $headers,
|
'headers' => $headers,
|
||||||
|
'post' => 'POST' === request()->method() ? json_encode(request()->all()) : '',
|
||||||
];
|
];
|
||||||
|
|
||||||
// create job that will mail.
|
// create job that will mail.
|
||||||
$ipAddress = request()->ip() ?? '0.0.0.0';
|
$ipAddress = request()->ip() ?? '0.0.0.0';
|
||||||
$job = new MailError($userData, (string) config('firefly.site_owner'), $ipAddress, $data);
|
$job = new MailError($userData, (string) config('firefly.site_owner'), $ipAddress, $data);
|
||||||
dispatch($job);
|
dispatch($job);
|
||||||
|
|
||||||
parent::report($e);
|
parent::report($e);
|
||||||
@ -231,7 +232,7 @@ class Handler extends ExceptionHandler
|
|||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
*/
|
*/
|
||||||
protected function invalid($request, LaravelValidationException $exception): \Illuminate\Http\Response|JsonResponse|RedirectResponse
|
protected function invalid($request, LaravelValidationException $exception): \Illuminate\Http\Response | JsonResponse | RedirectResponse
|
||||||
{
|
{
|
||||||
// protect against open redirect when submitting invalid forms.
|
// protect against open redirect when submitting invalid forms.
|
||||||
$previous = app('steam')->getSafePreviousUrl();
|
$previous = app('steam')->getSafePreviousUrl();
|
||||||
@ -239,18 +240,17 @@ class Handler extends ExceptionHandler
|
|||||||
|
|
||||||
return redirect($redirect ?? $previous)
|
return redirect($redirect ?? $previous)
|
||||||
->withInput(Arr::except($request->input(), $this->dontFlash))
|
->withInput(Arr::except($request->input(), $this->dontFlash))
|
||||||
->withErrors($exception->errors(), $request->input('_error_bag', $exception->errorBag))
|
->withErrors($exception->errors(), $request->input('_error_bag', $exception->errorBag));
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function shouldntReportLocal(\Throwable $e): bool
|
private function shouldntReportLocal(\Throwable $e): bool
|
||||||
{
|
{
|
||||||
return null !== Arr::first(
|
return null !== Arr::first(
|
||||||
$this->dontReport,
|
$this->dontReport,
|
||||||
static function ($type) use ($e) {
|
static function ($type) use ($e) {
|
||||||
return $e instanceof $type;
|
return $e instanceof $type;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,10 +46,10 @@ class TransactionGroupTransformer extends AbstractTransformer
|
|||||||
private ExchangeRateConverter $converter;
|
private ExchangeRateConverter $converter;
|
||||||
private array $currencies = [];
|
private array $currencies = [];
|
||||||
private TransactionCurrency $default;
|
private TransactionCurrency $default;
|
||||||
private array $meta;
|
private array $meta = [];
|
||||||
private array $notes;
|
private array $notes = [];
|
||||||
private array $locations;
|
private array $locations = [];
|
||||||
private array $tags;
|
private array $tags = [];
|
||||||
|
|
||||||
public function collectMetaData(Collection $objects): void
|
public function collectMetaData(Collection $objects): void
|
||||||
{
|
{
|
||||||
|
@ -116,6 +116,7 @@ return [
|
|||||||
'error_github_text' => 'If you prefer, you can also open a new issue on https://github.com/firefly-iii/firefly-iii/issues.',
|
'error_github_text' => 'If you prefer, you can also open a new issue on https://github.com/firefly-iii/firefly-iii/issues.',
|
||||||
'error_stacktrace_below' => 'The full stacktrace is below:',
|
'error_stacktrace_below' => 'The full stacktrace is below:',
|
||||||
'error_headers' => 'The following headers may also be relevant:',
|
'error_headers' => 'The following headers may also be relevant:',
|
||||||
|
'error_post' => 'This was submitted by the user:',
|
||||||
|
|
||||||
// Ignore this comment
|
// Ignore this comment
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -52,5 +52,13 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</p>
|
</p>
|
||||||
|
{% if ('' != post %}
|
||||||
|
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;">
|
||||||
|
{{ trans('email.error_post') }}
|
||||||
|
</p>
|
||||||
|
<p style="font-family: monospace;font-size:11px;color:#aaa">
|
||||||
|
{{ post }}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% include 'emails.footer-html' %}
|
{% include 'emails.footer-html' %}
|
||||||
|
@ -33,5 +33,10 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if ('' != post %}
|
||||||
|
{{ trans('email.error_post') }}
|
||||||
|
|
||||||
|
{{ post }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% include 'emails.footer-text' %}
|
{% include 'emails.footer-text' %}
|
||||||
|
Loading…
Reference in New Issue
Block a user