Page MenuHomeDevCentral

1st commit
ClosedPublic

Authored by inidal on Feb 1 2023, 19:09.
Tags
None
Referenced Files
F2841856: D2763.id7092.diff
Tue, Apr 23, 00:32
F2840443: D2763.id7092.diff
Mon, Apr 22, 20:21
Unknown Object (File)
Sun, Apr 21, 09:46
Unknown Object (File)
Fri, Apr 19, 07:45
Unknown Object (File)
Thu, Apr 18, 20:32
Unknown Object (File)
Thu, Apr 18, 11:12
Unknown Object (File)
Thu, Apr 18, 09:59
Unknown Object (File)
Wed, Apr 17, 02:39

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.