dingo / api

A RESTful API package for the Laravel and Lumen frameworks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

personalize message error UnknownVersionException to spanish

FuriosoJack opened this issue · comments

Q A
Bug? no
New Feature? yes
Framework Laravel
Framework version 5.7.y
Package version 2.4.y
PHP version 7.2

Actual Behaviour

Add message language exeptions

commented

Hi, this is not really the responsibility of the package, but yours as developer of the application.

There's a lot of exceptions that get thrown around, and most of them are not even inside of this package. If you need to return localised error messages, you should set the exception message yourself.

Hi, this is not really the responsibility of the package, but yours as developer of the application.

There's a lot of exceptions that get thrown around, and most of them are not even inside of this package. If you need to return localised error messages, you should set the exception message yourself.

I disagree. For example, the exception when the Accept header is not sent. That exception is not documented so it is very tedious to look for the exceptions and know what is the class to make a hook according to the instanceof and so now that is with one but now with many it is a tedious task.

commented

@FuriosoJack Yes but, these exceptions are not actually meant to be read by humans (or I should clarify, customers/consumers), they are meant to be read by either other APIs or developers debugging them.

You should not display these exceptions' messages to your end users - only things like validation errors (which are translated).