diff options
| -rw-r--r-- | lib/tasks/organisations.rake | 6 | ||||
| -rw-r--r-- | lib/tasks/users.rake | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/tasks/organisations.rake b/lib/tasks/organisations.rake index 24b02b630..94a9215b7 100644 --- a/lib/tasks/organisations.rake +++ b/lib/tasks/organisations.rake @@ -9,7 +9,11 @@ namespace :organisations do end resp = conn.get '/api/v1/organizations' - JSON.parse resp.body if resp.status == 200 + if resp.status == 200 + JSON.parse resp.body + else + raise "Error on api request status : #{resp.status} => #{resp.body}" + end end def sync_organisations data diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake index ca2264381..15c76a240 100644 --- a/lib/tasks/users.rake +++ b/lib/tasks/users.rake @@ -9,7 +9,11 @@ namespace :users do end resp = conn.get '/api/v1/users' - JSON.parse resp.body if resp.status == 200 + if resp.status == 200 + JSON.parse resp.body + else + raise "Error on api request status : #{resp.status} => #{resp.body}" + end end def sync_users data |
