errors to exceptions