specs for services

This commit is contained in:
Karol
2019-12-09 20:35:49 +01:00
parent c89ee6c102
commit 46e7853465
16 changed files with 1029 additions and 13 deletions

View File

@ -16,8 +16,8 @@ module ExerciseService
response_hash = JSON.parse(response.body, symbolize_names: true)
{error: false}.merge(response_hash.slice(:message, :exercise_found, :update_right))
rescue Faraday::Error => e
{error: true, message: I18n.t('exercises.export_codeharbor.error', message: e.message)}
rescue Faraday::Error, JSON::ParserError
{error: true, message: I18n.t('exercises.export_codeharbor.error')}
end
private