Error Codes
ForkYeahProblemCode defines the library’s error catalogue.
Every code maps to HTTP 400 Bad Request.
| Code | Name | When it’s raised |
|---|---|---|
|
|
Generic fork failure — used as a fallback when the fork mode is missing or unknown. |
|
|
A |
|
|
A |
|
|
A |
The right code for a given situation is selected via the helpers on ForkMode:
throw Problem.of(ForkMode.toProblemCode(forkSource))
.withInfo("forkFrom", forkSource, "targetPeriod", target.getSeason())
.toThrowable();
ForkMode.toProblemCode(…) accepts either a ForkSource or a raw ForkMode and falls back to InvalidForkOperation when the input is null.
Always prefer this over hard-coding a specific code — it keeps the response aligned with the mode that was actually attempted.
The codes register themselves automatically with conta-problem-json via the static initialiser on ForkYeahProblemCode, so they show up in the generated problem JSON catalogue without further wiring.