export interface ProblemDetails {
  type?: string
  title: string
  status: number
  detail?: string
  traceId?: string
  errors?: Record<string, string[]>
}

export class ApiProblem extends Error {
  constructor(public readonly problem: ProblemDetails) {
    super(problem.title)
  }

  get status(): number { return this.problem.status }
}
