Skip to content

Is error reporting broken? #25

@hipsterjazzbo

Description

@hipsterjazzbo

When some of my code throws an \Error or \Exception, the error I get back includes a "location", but no indication of where the error occurred — no file, or class name, or trace.

Is this by design? Could we do something like this in formatError()?

if (!empty($prev)) {
	if ($prev instanceof ValidationError) {
		$error['validation'] = $prev->getValidatorMessages()->toArray();
	} else if ($prev instanceof \Throwable) {
	    // Throw in the trace so one can know where an exception occurred
            $error['trace'] = explode("\n", $prev->getTraceAsString());
        }
}

That would give us a nicely formatted trace back to where the original \Throwable was thrown, so the error is findable (though it should probably be switched based on env(APP_DEBUG))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions