atagen

malice

public
Star0
Watch0
6e2fb9d7f322d8990cca482ae98f526fac5a389e
2
ssh://brewery@pls.lobotomise.me:33/atagen/malice.git
web/src/lib/wire-status.tsTypescript17 lines359 B
1
export const STATUS_BY_KIND: Record<string, number> = {
2
  bad_request: 400,
3
  not_found: 404,
4
  conflict: 409,
5
  busy: 429,
6
  too_large: 413,
7
  unsupported: 415,
8
  engine_stopped: 502,
9
  upstream: 502,
10
  unauthorized: 401,
11
  forbidden: 403,
12
  store_in_use: 409
13
};
14
15
export function statusForKind(kind: string): number {
16
  return STATUS_BY_KIND[kind] ?? 502;
17
}