D
D
Denis2021-01-14 17:14:50
PHP
Denis, 2021-01-14 17:14:50

Why do Eloquent model exceptions always have an error code of 0?

Why does findOrFail and similar throw error code 0 and not some normal one? Should I write in tests that an exception with code 0 is expected? What other exceptions can be thrown by such code so as not to be confused later?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2021-01-22
@dlnsk

https://phpunit.readthedocs.io/en/latest/writing-t...
Just remember to call this method before calling a method that might raise an exception.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question