About

This repository is an example of how I like to do error handling with axum with the help of enum_convert to avoid some repetitive From implementations.

The code implements a dummy job runner API with those few routes:

  • POST /jobs to create a job
  • GET /jobs to get the jobs list
  • GET /job/{job_id} to get a specific job
  • POST /job/{job_id}/reset to reset a job state
  • POST /job/{job_id}/cancel to cancel a job so that it does not get executed

The main idea for error handling is that each route handler has its own error type (see [CancelJobError](https://github.com/avandecreme/axum-error-example/blob/main/src/bin/axum_error_example/api/…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help