Custom error object with code of http error