ExceptionReporter
class ExceptionReporter (View source)
Properties
| protected bool | $reportingViewException | Indicates the currently reporting exception is a view exception. |
|
| protected BladeMapper|null | $bladeMapper | The Blade mapper resolved for the currently reporting exception. |
|
| protected Throwable, string> | $exceptionIds | The captured identifiers, keyed by exception. |
|
| protected float|null | $octaneRequestReceivedAt | The time the Octane request was received. |
|
| protected string|null | $currentlyRunningCommandName | The name of the currently running Artisan command. |
|
| protected string|null | $artisanCommandTraceId | The trace ID for the current artisan command execution. |
|
| protected Input|null | $currentConsoleInput | The console input of the currently running Artisan command. |
|
| protected ArgvInput|null | $currentFallbackArgvInput | The console input built from the process arguments. Fallback when console input is not yet set. |
|
| protected Event|null | $currentlyRunningScheduledTask | The currently running scheduled task. |
|
| protected bool | $scheduledTaskAwaitingFailureReport | Indicates the currently running scheduled task has finished with its failure yet to be reported. |
|
| protected Job|null | $currentlyProcessingJob | The currently executing job on the queue. |
|
| protected string|null | $currentlyProcessingJobAttemptId | The currently executing job attempt ID. |
|
| protected array<string, string> | $normalizedQueues | The cached normalized queue names, keyed by "connection:queue". |
|
| protected array<string, mixed>|null | $connectionConfig | The cached queue configuration. |
|
| protected array{job: array<string, mixed>, scheduled_task: array<string, mixed>} | $executionContext | Proactively captured execution context, keyed by execution type. |
|
| protected string|null | $reservedMemory | The memory reserved for reporting fatal errors. |
Methods
Create a new Exception Reporter instance.
Retrieve the current timestamp.
Retrieve the current Laravel Context.
Prepare for an incoming Octane request.
Retrieve the request headers.
Remove the headers PHP derives from the Authorization header.
Redact the configured sensitive headers.
Redact the given authorization header value, retaining the scheme.
Redact the given cookie header value, retaining the cookie names.
Retrieve the requested URL.
Retrieve the route specific request execution context.
Redact the configured sensitive fields in the given payload.
Determine if the given payload field should be redacted.
Parse the given uploaded files into their reportable details.
Prepare to process the given command.
Retrieve the console command execution trace ID.
Retrieve the name of the currently running Artisan command.
Retrieve the class name of the currently running Artisan command.
Retrieve the redacted command line.
Retrieve a transformer for the given console argument.
Retrieve a transformer for the given console option.
Apply the given transformation to each of the given input's values.
Determine if the given command argument or option should be redacted.
Retrieve the console input of the currently running Artisan command.
Retrieve the fallback console input built from the process arguments.
Flush the currently running scheduled task context.
Determine if a scheduled task is running.
Retrieve the currently running scheduled task's execution context.
Retrieve the name of the currently running scheduled task.
Retrieve the name of the currently running scheduled callback task.
Retrieve the class name of the currently running scheduled task.
Retrieve the class name of the currently running scheduled callback task.
Retrieve the callback of the currently running scheduled task.
Retrieve the timezone of the currently running scheduled task.
Flush currently processing job context.
Determine if a queue worker is running.
Retrieve the trace identifier the current job belongs to.
The currently processing job attempt ID.
Normalize the given queue name.
Capture the authenticated user's identifier in the given context.
Capture the trace identifier of the current execution in the given context.
Retrieve the current user ID.
Retrieve the authenticated user's identifier from the context.
Determine the type information of the given argument.
Normalize the file and line number.
Map compiled views to their original view file paths.
Retrieve the Blade mapper.
Redact the given value.
Normalize the file path's base path.
Retrieve the time Laravel started.
Details
__construct(Events $events, Closure $bladeMapperResolver, string $basePath, array $config)
Create a new Exception Reporter instance.
bool|null
__invoke(Throwable $e)
Report the given exception.
string
exceptionId(Throwable $e)
Retrieve the identifier for the given exception.
protected Throwable
unwrapViewException(Throwable $e)
Unwrap view exceptions and remember the original exception.
protected bool
isViewException(Throwable $e)
Determine if the given exception is a view exception.
protected array
payload(Throwable $e)
Create the exception payload.
protected string
timestamp()
Retrieve the current timestamp.
protected object|null
exceptionContext(Throwable $e)
Retrieve the context for the given exception.
protected object|null
laravelContext()
Retrieve the current Laravel Context.
protected array
executionDetails(Throwable $e)
Retrieve the execution context.
void
prepareForOctaneRequest()
Prepare for an incoming Octane request.
protected array
requestExecutionDetails(Throwable $e)
Retrieve the request execution context.
protected array|null
requestHeaders()
Retrieve the request headers.
protected void
removeSyntheticAuthorizationHeaders(HeaderBag $headers)
Remove the headers PHP derives from the Authorization header.
protected void
redactHeaders(HeaderBag $headers)
Redact the configured sensitive headers.
protected string
redactAuthorizationHeaderValue(string $value)
Redact the given authorization header value, retaining the scheme.
protected string
redactCookieHeaderValue(string $value)
Redact the given cookie header value, retaining the cookie names.
protected string
requestUrl()
Retrieve the requested URL.
protected array|null
requestRouteExecutionDetails()
Retrieve the route specific request execution context.
protected array|null
requestPayload(Throwable $e)
Retrieve the request payload.
protected array
redactRequestPayload(array $payload)
Redact the configured sensitive fields in the given payload.
protected bool
shouldRedactRequestPayloadField(string $field, mixed $value)
Determine if the given payload field should be redacted.
protected array|null
requestFiles(Throwable $e)
Retrieve the parsed uploaded files.
protected array
parseRequestFiles(array $files)
Parse the given uploaded files into their reportable details.
Values are uploaded files, or nested arrays of them.
void
prepareForCommand(string $name, InputInterface $input)
Prepare to process the given command.
protected array
consoleCommandExecutionDetails(Throwable $e)
Retrieve the console execution context.
protected string
consoleCommandTraceId()
Retrieve the console command execution trace ID.
protected string|null
consoleCommandName()
Retrieve the name of the currently running Artisan command.
protected string|null
consoleCommandClass()
Retrieve the class name of the currently running Artisan command.
protected string|null
consoleCommandLine()
Retrieve the redacted command line.
protected callable
consoleArgumentTransformer(string $name)
Retrieve a transformer for the given console argument.
protected callable
consoleOptionTransformer(string $name)
Retrieve a transformer for the given console option.
protected array
applyTransformationToConsoleInputValue(null|bool|string|array $value, callable $transformer)
Apply the given transformation to each of the given input's values.
protected bool
shouldRedactConsoleInputValue(string $name)
Determine if the given command argument or option should be redacted.
protected Input
currentConsoleInput()
Retrieve the console input of the currently running Artisan command.
protected ArgvInput
currentFallbackArgvInput()
Retrieve the fallback console input built from the process arguments.
void
prepareForScheduledTask(Event $task)
Prepare to run the given scheduled task.
void
finishScheduledTask(Event $task)
Handle the given scheduled task finishing.
void
flushScheduledTaskContext()
Flush the currently running scheduled task context.
protected bool
isRunningScheduledTask()
Determine if a scheduled task is running.
protected array
scheduledTaskExecutionDetails(Throwable $e)
Retrieve the currently running scheduled task's execution context.
protected string
scheduledTaskName()
Retrieve the name of the currently running scheduled task.
protected string
scheduledCallbackTaskName()
Retrieve the name of the currently running scheduled callback task.
protected string
scheduledClosureTaskName(Closure $callback)
Retrieve the name of the given scheduled closure task.
protected string|null
scheduledTaskClass()
Retrieve the class name of the currently running scheduled task.
protected string|null
scheduledCallbackTaskClass()
Retrieve the class name of the currently running scheduled callback task.
protected mixed
scheduledTaskCallback()
Retrieve the callback of the currently running scheduled task.
protected string|null
scheduledTaskTimezone()
Retrieve the timezone of the currently running scheduled task.
void
prepareForJob(Job $job)
Prepare to process the given job.
void
flushJobContext()
Flush currently processing job context.
protected bool
isProcessingJob()
Determine if a queue worker is running.
protected array
jobExecutionDetails(Throwable $e)
Retrieve the currently processing job's execution context.
protected string|null
traceIdFromContext()
Retrieve the trace identifier the current job belongs to.
protected string
currentlyProcessingJobAttemptId()
The currently processing job attempt ID.
protected string
normalizedQueue()
Normalize the given queue name.
void
rememberUser(Authenticatable $user)
Remember the given user as they log out.
void
handleContextDehydrating(Repository $context)
Handle context dehydrating.
protected void
rememberUserIdInContext(Repository $context)
Capture the authenticated user's identifier in the given context.
protected void
rememberTraceIdInContext(Repository $context)
Capture the trace identifier of the current execution in the given context.
protected string|null
userId()
Retrieve the current user ID.
protected string|null
userIdFromContext()
Retrieve the authenticated user's identifier from the context.
protected string|null
userIdentifier(Authenticatable $user)
Retrieve the identifier of the given user.
protected bool
handled(Throwable $e)
Determine if the exception was handled.
protected array
parseException(Throwable $e)
Parse the given exception.
protected array
previous(Throwable $e)
Parse the previous exceptions.
protected array
trace(Throwable $e)
Parse the stack trace for the given exception.
protected string|array
argType(mixed $argument, string|int $name)
Determine the type information of the given argument.
protected array
normalizeFrameFileAndLine(array $frame)
Normalize the file and line number.
protected array
mapCompiledViewFrame(array $frame)
Map compiled views to their original view file paths.
protected BladeMapper
bladeMapper()
Retrieve the Blade mapper.
The mapper is only needed while reporting a view exception, and is resolved when it is first needed.
protected string
redactValue(string $value)
Redact the given value.
protected string
normalizeBasePath(string $path)
Normalize the file path's base path.
protected string|null
laravelStartedAtTimestamp()
Retrieve the time Laravel started.