how to handle error for response type blob