Skip to content

Commit

Permalink
Handle error logging in index
Browse files Browse the repository at this point in the history
  • Loading branch information
runely committed Apr 3, 2022
1 parent 0632dbc commit f87acfb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions UpdateTerms/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const updateTermStore = async (context, req) => {
})
}
} catch (err) {
logger('error', ['sector', sector.Sektor, 'failed to create sector term 😡', err.message])
logger('error', ['sector', sector.Sektor, 'failed to create sector term 😡', err.statusCode, err.message])
outputLog.push({
type: 'ERROR',
sector: sector.Sektor,
Expand Down Expand Up @@ -131,7 +131,7 @@ const updateTermStore = async (context, req) => {
})
}
} catch (err) {
logger('error', ['section', section.Seksjon, 'failed to create section term 😡', err.message])
logger('error', ['section', section.Seksjon, 'failed to create section term 😡', err.statusCode, err.message])
outputLog.push({
type: 'ERROR',
sector: sector.Sektor,
Expand Down Expand Up @@ -198,7 +198,7 @@ const updateTermStore = async (context, req) => {
})
}
} catch (err) {
logger('error', ['team', team.Team, 'failed to create team term 😡', err.message])
logger('error', ['team', team.Team, 'failed to create team term 😡', err.statusCode, err.message])
outputLog.push({
type: 'ERROR',
sector: sector.Sektor,
Expand Down
1 change: 0 additions & 1 deletion lib/graph/get-graph-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ module.exports = async () => {
return token
} catch (error) {
const { status, data } = error.response
logger('error', ['get-graph-token', 'error', status, data])
throw new HTTPError(status || 401, data || 'Failed to get graph token', error)
}
}
1 change: 0 additions & 1 deletion lib/graph/handle-graph-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const callGraph = async payload => {
return data
} catch (error) {
const { status, data } = error.response
logger('error', ['handle-graph-data', 'error', status, data])
throw new HTTPError(status || 500, data || 'Failed to get graph data', error)
}
}
Expand Down

0 comments on commit f87acfb

Please sign in to comment.