Conversation
changelog: Improvements, In-person proofing, log more error details
| it 'logs the error to NewRelic' do | ||
| expect(NewRelic::Agent).to receive(:notice_error). | ||
| with(instance_of(Faraday::BadRequestError)) | ||
| job.perform(Time.zone.now) | ||
| end |
There was a problem hiding this comment.
Would we want "logs the error to NewRelic" to be an assertion as part of the shared example set enrollment_encountering_an_exception ?
There was a problem hiding this comment.
Yeah that makes sense. The only downside is it's a little complicated to make the example set know which type of error NewRelic::Agent#receive should be called with so I lean towards just expecting the method to be called and not specifying the error type it should receive
There was a problem hiding this comment.
Actually there are a couple of error types which we aren't currently reporting to NewRelic, such as if USPS returns something to us other than a hash when we expect a hash. I don't know if it's useful to log those to NewRelic...I guess we could construct a StandardError with some error string content
I'm now leaning towards leaving it out of the example set, how it is right now
🎫 Ticket
LG-7706
🛠 Summary of changes
When the USPS polling job encounters an unexpected bad request error begin logging it to NewRelic