Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mailer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
services
mailer
Commits
e20d5b0b
Commit
e20d5b0b
authored
5 years ago
by
FORESTIER Fabien
Browse files
Options
Downloads
Patches
Plain Diff
Fix uncorrectly used Logger
parent
e1e9fa9d
No related branches found
No related tags found
1 merge request
!3
Version 1.2.1
Pipeline
#2448
passed
5 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/email/email.service.ts
+5
-5
5 additions, 5 deletions
src/email/email.service.ts
with
5 additions
and
5 deletions
src/email/email.service.ts
+
5
−
5
View file @
e20d5b0b
...
...
@@ -112,7 +112,7 @@ export class EmailService {
try
{
conn
=
await
amqp
.
connect
(
rabbitmqUrl
);
}
catch
(
error
)
{
L
ogger
.
error
(
'
Error connecting to RabbitMQ
'
,
error
,
`
${
EmailService
.
name
}
-
${
this
.
send
.
name
}
`
);
this
.
l
ogger
.
error
(
'
Error connecting to RabbitMQ
'
,
error
,
`
${
EmailService
.
name
}
-
${
this
.
send
.
name
}
`
);
throw
new
InternalServerErrorException
(
'
Could not connect to rabbitMQ.
'
);
}
...
...
@@ -120,7 +120,7 @@ export class EmailService {
// Create a communication channel
ch
=
await
conn
.
createChannel
();
}
catch
(
error
)
{
L
ogger
.
error
(
'
Error creating channel
'
,
error
,
`
${
EmailService
.
name
}
-
${
this
.
send
.
name
}
`
);
this
.
l
ogger
.
error
(
'
Error creating channel
'
,
error
,
`
${
EmailService
.
name
}
-
${
this
.
send
.
name
}
`
);
throw
new
InternalServerErrorException
(
'
Could not create channel.
'
);
}
...
...
@@ -130,18 +130,18 @@ export class EmailService {
try
{
await
ch
.
assertQueue
(
mailerQueue
,
{
durable
:
true
});
}
catch
(
error
)
{
L
ogger
.
error
(
'
Error asserting queue
'
,
error
,
`
${
EmailService
.
name
}
-
${
this
.
send
.
name
}
`
);
this
.
l
ogger
.
error
(
'
Error asserting queue
'
,
error
,
`
${
EmailService
.
name
}
-
${
this
.
send
.
name
}
`
);
throw
new
InternalServerErrorException
(
'
Could not assert queue.
'
);
}
try
{
await
ch
.
sendToQueue
(
mailerQueue
,
buffer
,
{
persistent
:
true
});
}
catch
(
error
)
{
L
ogger
.
error
(
'
Error sending to queue
'
,
error
,
`
${
EmailService
.
name
}
-
${
this
.
send
.
name
}
`
);
this
.
l
ogger
.
error
(
'
Error sending to queue
'
,
error
,
`
${
EmailService
.
name
}
-
${
this
.
send
.
name
}
`
);
throw
new
InternalServerErrorException
(
'
Could not send to queue.
'
);
}
L
ogger
.
log
(
this
.
l
ogger
.
log
(
`Sent to queue
${
mailerQueue
}
,{ from:
${
email
.
from
}
, to:
${
email
.
to
}
, subject:
${
email
.
subject
}
}`
,
`
${
EmailService
.
name
}
-
${
this
.
send
.
name
}
`
,
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment