Adding error handling to terminal
Completed terminal