YoVDO

Symfony RESTful API: Errors (Course 2)

Offered By: SymfonyCasts

Tags

Symfony Courses JSON Courses

Course Description

Overview

In course 1, we added our basic endpoints with some nice tests (yes!).

Now, we turn to a huge part of APIs: handling and returning consistent errors. Seriously, this is more important than you might think - which is why we're covering this in episode 2.

So, let's handle errors, and let's do it gracefully:

  • Handling Form Validation errors and response
  • Disabling csrf_protection
  • Introducing the api-problem JSON format
  • Exception Listener!
  • Consistent errors everywhere: 404's, 500's, oh my!
  • Handling "extra fields" in your form

Syllabus

  • Validation Errors Test
  • Sending back Validation Errors
  • PUT Validation and CSRF Tokens
  • 99 api/problem+json(s)
  • Modeling the Error: ApiProblem Class
  • Keeping Problem types Consistent
  • The All-Important HttpExceptionInterface
  • Creating the Invalid JSON ApiProblem, and then...
  • ApiProblemException
  • Request Format: Why Exceptions Return HTML
  • Global RESTful Exception Handling
  • Handling 404's + other Errors
  • The Helpful Detail Key
  • Debugging and Cleanup

Taught by

Ryan Weaver and Leanna Pelham

Related Courses

Master en webs Full Stack: Angular, Node, Laravel, Symfony +
Udemy
Master en PHP, SQL, POO, MVC, Laravel, Symfony, WordPress +
Udemy
MVC Frameworks for Building PHP Web Applications
LinkedIn Learning
PHP Symfony FW ile Sıfırdan Gelişmiş Uygulama Geliştirme
Udemy
Learn PHP Symfony Hands-On Creating Real World Application
Udemy