error handling and error object population