Nidhal Baccouri
add common function to check request failure
3aa1058