Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Build a REST API in Spark!
You have completed Build a REST API in Spark!
Preview
An often overlooked task in designing an API is what to do when errors happen. Let's use Spark's exception handling to make sure we pass user friendly information.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
care of informing callers of our API
about errors that they might encounter.
0:00
One of the reasons for this is
because we as JAVA developers get so
0:04
used to letting exceptions
take care of the, well,
0:08
exceptional things that
could happen in our code.
0:11
Now the problem is, clients don't get
the benefit of reading our stack trace or
0:14
the error messages,
they make no sense out of context.
0:18
Let's see what we can do about better
communicating when things go south.
0:21
Okay, so remember Spark has a pretty
handy way to handle specific exceptions.
0:25
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up