Skip to content

Commit

Permalink
Merge branch '515/Better-error-handling' of github.com:hpi-swt2/vm-po…
Browse files Browse the repository at this point in the history
…rtal into 515/Better-error-handling
  • Loading branch information
chrisma committed Apr 26, 2019
2 parents e1eff20 + 0c0640f commit d9c447b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def notify(title, message, link = '', type: :default)
else
notify_slack("*#{title}*\n#{message}\n#{link}")
NotificationMailer.with(user: self, title: '[HART] ' + title.to_s, message: (message + link).to_s).notify_email.deliver_now if email_notifications
notification.save # saving might fail, but there is no useful way to handle the error.
notification.save
# saving might fail, there is however no good way to handle this error.
# We cannot log the error, because when using the HartFormatter, logging errors creates new notifications,
# these might also fail to save, creating an endless recursion.
end
end

Expand Down

0 comments on commit d9c447b

Please sign in to comment.