Return error when keystore read fails (don't panic) #46

Closed
opened 2022-06-14 08:22:27 +00:00 by glyph · 1 comment
Owner

Behaviour:

Internal Server Error when navigating to the Scuttlebutt status page.

Steps to reproduce:

Run PeachPub on a computer without go-sbot installed, login to the web interface and click on the Status icon.

Error message:

thread '<unnamed>' panicked at 'couldn't read local secret: SyncIo(Custom { kind: NotFound, error: VerboseError { source: Os { code: 2, kind: NotFound, message: "No such file or directory" }, message: "could not open /home/cordyceps/.ssb-go/secret" } })', /home/cordyceps/.cargo/git/checkouts/golgi-bf299908ffde79a1/0aa616d/src/sbot.rs:75:18

Error source:

0aa616d92b/src/sbot.rs (L72)

Suggested fix:

Return a GolgiError using the ? operator, rather than using expect. Handle the error in PeachPub and show an appropriate message to the user.

**Behaviour**: Internal Server Error when navigating to the Scuttlebutt status page. **Steps to reproduce**: Run PeachPub on a computer without go-sbot installed, login to the web interface and click on the Status icon. **Error message**: `thread '<unnamed>' panicked at 'couldn't read local secret: SyncIo(Custom { kind: NotFound, error: VerboseError { source: Os { code: 2, kind: NotFound, message: "No such file or directory" }, message: "could not open `/home/cordyceps/.ssb-go/secret`" } })', /home/cordyceps/.cargo/git/checkouts/golgi-bf299908ffde79a1/0aa616d/src/sbot.rs:75:18` **Error source**: https://git.coopcloud.tech/golgi-ssb/golgi/src/commit/0aa616d92b005b38359aa34bf448f3f1f47e8e6a/src/sbot.rs#L72 **Suggested fix**: Return a `GolgiError` using the `?` operator, rather than using `expect`. Handle the error in PeachPub and show an appropriate message to the user.
glyph added the
bug
enhancement
labels 2022-06-14 08:22:27 +00:00
Author
Owner

Addressed in #51

Addressed in https://git.coopcloud.tech/golgi-ssb/golgi/pulls/51
glyph closed this issue 2022-07-18 07:09:16 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: golgi-ssb/golgi#46
No description provided.