Courses

[NEW] Flutter 3 Mobile App with Laravel 12 API

Handling 404 API Error

Now that we have our CRUD operations, we should check that basic functionality works as expected. In this case, we want to ensure we correctly handle 404 errors. Let's look at the default way:

We can do better than this.


Correctly Handling 404 Error

We tried to load a category with the ID of 123 with our first test but got a long message. This was because we have APP_DEBUG=true in our .env file. We can change this to APP_DEBUG=false to see what we would get in a production environment:

The full lesson is only for Premium Members.
Want to access all 26 lessons of this course? (115 min read)

You also get:

  • 75 courses
  • Premium tutorials
  • Access to repositories
  • Private Discord