Skip to content

Errors not returning but being logged only even in Debug true. #85

Closed
@sahil-kindlebit

Description

@sahil-kindlebit

Hello,
I have this in my Exceptions/Handler.php

$this->renderable(
	\LaravelJsonApi\Exceptions\ExceptionParser::make()->acceptsJson()->renderable()
);

When there is some unknown error or you can say syntax error we get this even when
APP_DEBUG=true & APP_ENV=local,

{
	"jsonapi": {
		"version": "1.0"
	},
	"errors": [
		{
			"status": "500",
			"title": "Internal Server Error"
		}
	]
}

on the other hand if I remove the code added in the Exceptions/Handler.php and request wants json
I get this response ->

{
	"message": "syntax error, unexpected '$login' (T_VARIABLE)",
	"exception": "ParseError",
	"file": "/home/vagrant/code/app/Http/Controllers/api/v1/LoginController.php",
	"line": 14,
	"trace": [
		{
			"file": "/home/vagrant/code/vendor/composer/ClassLoader.php",
			"line": 344,
			"function": "Composer\\Autoload\\includeFile"
		},
		...
	]
}

Currently If I remove the code from handler then I am getting error, I want my errors to be returned in response as well when using LaravelJsonApi.
Please help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions