fix: export interface version of HttpException#56
Conversation
| import { SecuritySchemeObject, SecurityRequirementObject } from "openapi3-ts" | ||
|
|
||
| /** Export an interface version of HttpException to avoid class inheritance issues */ | ||
| export interface IHttpException |
There was a problem hiding this comment.
Do we want to name this IHttpException to keep the naming consistent with the base class, or IHttpError?
I also tried the suggested example from the github issue and it doesn't seem like KnownDeviceError can extend this interface as it is right now:

Is the intention to consolidate the two types by adding status, metadata, options to KnownDeviceError?
There was a problem hiding this comment.
yep I believe so
class-based usage is discouraged so I'd say IHttpError is better to stay consistent with the error interfaces on Seam Connect, or maybe even just HttpError
There was a problem hiding this comment.
@seveibar @codetheweb just to confirm, is this what we're thinking for the IHttpError interface?

We might have to add some attributes to seam-connect entities to implement this interface as shown in the screenshot.
For comparison, this is the existing HttpException class in nextlove:
declare class HttpException extends Error {
status: number;
metadata: HttpExceptionMetadata;
options: ThrowingOptions;
constructor(status: number, metadata: HttpExceptionMetadata, options?: ThrowingOptions);
toString(): string;
}
I need to take off for an appointment soon, but if we can get consensus on an approach I will merge later!
There was a problem hiding this comment.
yeah, I think we need metadata as well but otherwise looks good
| import { SecuritySchemeObject, SecurityRequirementObject } from "openapi3-ts" | ||
|
|
||
| /** Export an interface version of HttpException to avoid class inheritance issues */ | ||
| export interface IHttpException |
There was a problem hiding this comment.
| export interface IHttpException | |
| export interface IHttpException { | |
| is_http_exception: true, | |
| status: number | |
| message: string | |
| } |
No description provided.