handle error objects