Utility method to create an Error result from an error