Add better errors

Lets use the same error handling as the other applications for consistency