Added safety checks for error objects...

Some error objects lack a status code.  Updated code to default to a status code of 500 if that's the case.