Lesson 6: Validation & Error Handling

  Overview

Introduction

Welcome to lesson six! During this lesson you will continue work on the project you started in the previous lesson. You will learn how to add validation to your routes, and how to handle errors in your routes.

Topics for this lesson:

  • Validation
  • Error Handling
Have Feedback?

  Learning Material

Resources for this lesson are accessible to you in this repository

The following learning material may be helpful but is not required. Please reference the syllabus for more details.

  Team Assignment

Overview

Purpose: Gain exposure to Mongoose, which is widely used in industry in association with MongoDB.
Task: Complete the assignment.

Your team assigment this lesson will give you experience working with a complete RESTful API that uses MongoDB and Mongoose.


  Personal Assignment

Overview

Purpose: Gain experience performing CRUD operations
Task: Complete the assignment

Learning Objectives

By the end of this assignment the student will be able to do the following:

Assignment Description

For this assignment, you will build on the project you started in the previous lesson. Your tasks are as follows:

Rubric

CriteriaWeightMasteryProficientDevelopingBeginningMissing/Incomplete
100%90%78%65%0%
API Endpoints

(Graded via YouTube)
30%Meets Proficient criteria. The PUT returns 204 status and the DELETE returns a 200 statusMeets Developing criteria and performs at least one PUT request. MongoDB is modifiedMeets Beginning criteria and performs at least one DELETE request. MongoDB is modifiedVideo shows PUT and DELETE API endpoints being tested on RenderRender link or YouTube link not submitted; or no evidence of API endpoints or Render connection
Data Validation

(Graded via YouTube)
25%Meets Proficient criteria and each route has data validation, and returns some type of 400 or 500 error if data requirements aren't metMeets Developing criteria and data validation is being used in each route in project (from previous lesson: GET and POST)Meets Beginning criteria and data validation is being used in each route for this assignment (PUT and DELETE)Node project has evidence of data validation (for example: checks for at least one variable's existence, or for a specific data type/rule before continuing)GitHub link or YouTube link not submitted; or no evidence of data validation
Error Handling

(Graded via YouTube)
25%Meets Proficient criteria and each route has error handling, and it returns some type of 400 or 500 status if error is caughtMeets Developing criteria and error handling is being used in each route in project (from previous lesson: GET and POST)Meets Beginning criteria and error handling is being used in each route for this assignment (PUT and DELETE)Node project has evidence of error handling (for example: at least one try/catch)GitHub link or YouTube link not submitted; or no evidence of error handling
Update API Documentation

(Graded via YouTube)
20%Meets Proficient criteria and contains documentation for each route in the applicationMeets Developing criteria and the API documentation can test the endpoints on RenderMeets Beginning criteria and at least one of the following HTTP request types are present in the documentation: GET all, GET by id, PUT, POST, and DELETEThe swagger.json file is present (or Apollo server link for GraphQL)Render, or YouTube links not submitted; or no evidence of API documentation