Page MenuHomeDevCentral

1st commit
ClosedPublic

Authored by inidal on Feb 1 2023, 19:09.
Tags
None
Referenced Files
F3751619: D2763.diff
Sun, Nov 17, 11:01
Unknown Object (File)
Sat, Nov 16, 04:02
Unknown Object (File)
Sat, Nov 16, 04:02
Unknown Object (File)
Sat, Nov 16, 04:02
Unknown Object (File)
Sat, Nov 16, 04:01
Unknown Object (File)
Sat, Nov 16, 03:40
Unknown Object (File)
Sat, Nov 16, 03:19
Unknown Object (File)
Fri, Nov 15, 21:58

Diff Detail

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

Event Timeline

inidal requested review of this revision.Feb 1 2023, 19:09
inidal 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.
inidal marked an inline comment as done.