dot-handleError function

Handle error response