Skip to content

Commit

Permalink
refactor(metadata): add warning in sentry in case of not mapped subject
Browse files Browse the repository at this point in the history
  • Loading branch information
hugotiburtino committed Oct 30, 2024
1 parent 56c6af9 commit e169761
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/server/src/schema/metadata/resolvers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as R from 'ramda'

import { captureErrorEvent } from '~/error-event'
import { UserInputError } from '~/errors'
import { createNamespace, decodeId } from '~/internals/graphql'
import { resolveConnection } from '~/schema/connection/utils'
Expand Down Expand Up @@ -515,6 +516,15 @@ function getRaWSubject(id: number): RawSubject[] {
case 148619:
return [{ id: '1043', scheme: Scheme.SchoolSubject }]
default:
captureErrorEvent({
error: new Error(
'metadata: subject could not be mapped to field `about`',
),
errorContext: {
subjectId: id,
warning: 'It will break the export to Mein Bildungsraum',
},
})
return []
}
}
Expand Down

0 comments on commit e169761

Please sign in to comment.