Compare error object instead of message