mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-05 04:18:16 +00:00
log institutions API errors
This commit is contained in:
parent
f5513f36ca
commit
8d6505b518
2 changed files with 3 additions and 1 deletions
|
@ -80,6 +80,8 @@ makeAffiliationRequest = (requestOptions, callback = (error) ->) ->
|
|||
errorMessage = "#{response.statusCode}: #{body.errors}"
|
||||
else
|
||||
errorMessage = "#{requestOptions.defaultErrorMessage}: #{response.statusCode}"
|
||||
|
||||
logger.err path: requestOptions.path, body: requestOptions.body, errorMessage
|
||||
return callback(new Error(errorMessage))
|
||||
|
||||
callback(null, body)
|
||||
|
|
|
@ -20,7 +20,7 @@ describe "UserCreator", ->
|
|||
@addAffiliation = sinon.stub().yields()
|
||||
@UserCreator = SandboxedModule.require modulePath, requires:
|
||||
"../../models/User": User:@UserModel
|
||||
"logger-sharelatex":{log:->}
|
||||
"logger-sharelatex":{ log: sinon.stub(), err: sinon.stub() }
|
||||
'metrics-sharelatex': {timeAsyncMethod: ()->}
|
||||
"../Institutions/InstitutionsAPI": addAffiliation: @addAffiliation
|
||||
|
||||
|
|
Loading…
Reference in a new issue