Add further error handling for RAPI.