Module 2 – Start an application and handle failure paths
Each error branch changes what happens next
Write a state table: newly created, started, then stopped. The current contract reports an error if you request a capability before starting, or start an already started application. Test these cases one at a time in a copy of the program. Predict the message and whether execution continues before running.
Notice that the capability error handler in the supplied example only prints an error. Unlike the earlier handlers, it does not return. If your application cannot do useful work without the capability, choose and document an explicit failure policy. Do not describe a logged request as proof of production authorization: the sandbox checks started state and prints the request.
Complete this lesson
Answer every check correctly to earn your lesson certificate. Feedback helps you review and try again.
Sign in · Save your progress and earn a certificate for this lesson.