Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
web-et-numerique
LLLE_Project
Ecolyo
Commits
a02a8b88
Commit
a02a8b88
authored
Aug 20, 2021
by
Hugo SUBTIL
Browse files
feat(dacc): add better error handling
parent
47c3b515
Changes
1
Show whitespace changes
Inline
Side-by-side
src/targets/services/aggregatorUsageEvents.ts
View file @
a02a8b88
...
@@ -38,6 +38,9 @@ interface Indicator {
...
@@ -38,6 +38,9 @@ interface Indicator {
// Store all id of events read during the process
// Store all id of events read during the process
const
readUsageEvents
:
UsageEvent
[]
=
[]
const
readUsageEvents
:
UsageEvent
[]
=
[]
// Store error events
const
errorEvent
:
{
error
:
any
;
doctype
:
string
}[]
=
[]
const
sendIndicator
=
async
(
const
sendIndicator
=
async
(
indicator
:
Indicator
,
indicator
:
Indicator
,
client
:
Client
client
:
Client
...
@@ -943,6 +946,17 @@ const AggregatorUsageEvents = async ({
...
@@ -943,6 +946,17 @@ const AggregatorUsageEvents = async ({
client
,
client
,
uniqueReadUsageEvents
uniqueReadUsageEvents
)
)
if
(
errorEvent
.
length
>
0
)
{
// Build error
let
error
=
`Process end with
${
errorEvent
.
length
}
errors : `
errorEvent
.
forEach
(
el
=>
{
error
+=
`
${
el
.
doctype
}
, `
})
log
(
'
error
'
,
error
)
throw
error
}
log
(
'
info
'
,
'
End of service
'
)
log
(
'
info
'
,
'
End of service
'
)
}
}
...
...
build-token
@project_409_bot
mentioned in commit
54dabe4c
·
Aug 20, 2021
mentioned in commit
54dabe4c
mentioned in commit 54dabe4c3d1f48488fe4f786d90bbb68971ad2d4
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment