More closely follow Joyent's error handling guide