Page MenuHomeDevCentral

1st commit
ClosedPublic

Authored by ieli on Feb 1 2023, 19:09.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 23, 13:32
Unknown Object (File)
Tue, Oct 21, 16:34
Unknown Object (File)
Sat, Oct 18, 16:29
Unknown Object (File)
Sat, Oct 18, 09:26
Unknown Object (File)
Fri, Oct 17, 23:47
Unknown Object (File)
Thu, Oct 16, 15:00
Unknown Object (File)
Sun, Oct 12, 19:01
Unknown Object (File)
Fri, Oct 10, 13:22

Diff Detail

Repository
rNPUSH notification-push
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ieli requested review of this revision.Feb 1 2023, 19:09
ieli created this revision.
dereckson added inline comments.
src/main.rs
55

There is a last check we can do.

If it worked, we receive a response with HTTP code 200.
If there is any failure, the server can send a 500 (e.g. if RabbitMQ is down).

The reqwest response offers a status method to check if the code is 200/201/204:

if !res.status().is_success() {
   eprintln!("The notifications server can't process the notification.");
   exit(2); // Let's use another code so a script can know at what step it failed.
}

We aren't especially interested by the specifics, as the notifications center also logged the error in its own log, and there is nothing the push script or the user using it can do.

Prototype OK.

Style issues are handled in up-to-come D2903.

This revision is now accepted and ready to land.Mar 20 2023, 21:20
This revision was automatically updated to reflect the committed changes.
ieli marked an inline comment as done.