File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
app/services/task_service Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,11 @@ def execute
1212 body = @zip . string
1313 begin
1414 response = connection . post { |request | request_parameters ( request , body ) }
15- response . success? ? nil : response . body
15+ if response . success?
16+ nil
17+ else
18+ response . status == 401 ? I18n . t ( 'tasks.export_external_confirm.not_authorized' , account_link : @account_link . name ) : response . body
19+ end
1620 rescue StandardError => e
1721 e
1822 end
Original file line number Diff line number Diff line change 99 export_external_confirm :
1010 error : ' Der Export der Aufgabe (%{title}) ist fehlgeschlagen. <br> Fehler: %{error}'
1111 success : Aufgabe (%{title}) erfolgreich exportiert.
12+ not_authorized : Die Autorisierung mit "%{account_link}" konnte nicht hergestellt werden. Ist der API-Schlüssel korrekt?
1213 import :
1314 internal_error : Beim Import dieser Aufgabe ist auf CodeHarbor ein interner Fehler aufgetreten.
1415 import_confirm :
Original file line number Diff line number Diff line change 99 export_external_confirm :
1010 error : ' Export of task (%{title}) failed. <br> Error: %{error}'
1111 success : Task (%{title}) successfully exported.
12+ not_authorized : Authorization with could not be established with "%{account_link}". Is the API Key correct?
1213 import :
1314 internal_error : An internal error occurred on CodeHarbor while importing the exercise.
1415 import_confirm :
You can’t perform that action at this time.
0 commit comments