Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

phaus/error-service

Repository files navigation

EaaS - Error as a Service

Sometimes you need to have service, that just puts out HTTP Errors. Either on purpose or - even better - randomly.

So here it is!

Health Check

You can use /.well-known/health-check for your health probes of you container manager.

Random errors

You can call /errors/random for a totally random status.
Errors have a probability of 70%.

There is a - hardcoded - list of Errors:

var errorsList = [...]int{
 http.StatusInternalServerError,
 http.StatusServiceUnavailable,
 http.StatusBadRequest,
 http.StatusBadGateway,
 http.StatusConflict}

Your personal status

You can also call /codes/xxx for a result with that specific status code.
Everthing above 399 counts as an error.

The Generator

If you go to / you see the generator page. You can click the start button, and a background request will be done to /errors/random every 500ms.
All errors are listed.
You may click stop if you have enough errors.
You need to have javascript enable for that one.

Kill the app

You can forcefully kill the service by sending a POST to /kill. E.g.:

curl -X POST http://localhost:9000/kill

Building

You can build the service with build.sh - you need docker for that one.

Running

You can run the service with run.sh - you need docker for that one.

Pull from Docker

If there is already a version present, just do a docker pull phaus/error-service:latest

Enjoy! Leave a comment to tell me, what you are doing with this!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /