error handler with locations fleshed out