Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _examples/node-ts/server/server.gen.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* eslint-disable */
// node-ts v1.0.0 642309974d39b8627aaa432be234932d66aaa816
// --
// Code generated by webrpc-gen@v0.24.0 with ../../../gen-typescript generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.26.1-2-g0e89de9 with ../../../gen-typescript generator. DO NOT EDIT.
//
// webrpc-gen -schema=service.ridl -target=../../../gen-typescript -server -out=./server/server.gen.ts

export const WebrpcHeader = "Webrpc"

export const WebrpcHeaderValue = "webrpc@v0.24.0;gen-typescript@unknown;node-ts@v1.0.0"
export const WebrpcHeaderValue = "webrpc@v0.26.1-2-g0e89de9;gen-typescript@unknown;node-ts@v1.0.0"

// WebRPC description and code-gen version
export const WebRPCVersion = "v1"
Expand Down
18 changes: 9 additions & 9 deletions _examples/node-ts/webapp/client.gen.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* eslint-disable */
// node-ts v1.0.0 642309974d39b8627aaa432be234932d66aaa816
// --
// Code generated by webrpc-gen@v0.24.0 with ../../../gen-typescript generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.26.1-2-g0e89de9 with ../../../gen-typescript generator. DO NOT EDIT.
//
// webrpc-gen -schema=service.ridl -target=../../../gen-typescript -client -out=./webapp/client.gen.ts

export const WebrpcHeader = "Webrpc"

export const WebrpcHeaderValue = "webrpc@v0.24.0;gen-typescript@unknown;node-ts@v1.0.0"
export const WebrpcHeaderValue = "webrpc@v0.26.1-2-g0e89de9;gen-typescript@unknown;node-ts@v1.0.0"

// WebRPC description and code-gen version
export const WebRPCVersion = "v1"
Expand Down Expand Up @@ -333,16 +333,16 @@ export class WebrpcInternalErrorError extends WebrpcError {
}
}

export class WebrpcClientDisconnectedError extends WebrpcError {
export class WebrpcClientAbortedError extends WebrpcError {
constructor(
name: string = 'WebrpcClientDisconnected',
name: string = 'WebrpcClientAborted',
code: number = -8,
message: string = `client disconnected`,
message: string = `request aborted by client`,
status: number = 0,
cause?: string
) {
super(name, code, message, status, cause)
Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype)
Object.setPrototypeOf(this, WebrpcClientAbortedError.prototype)
}
}

Expand Down Expand Up @@ -463,7 +463,7 @@ export enum errors {
WebrpcBadResponse = 'WebrpcBadResponse',
WebrpcServerPanic = 'WebrpcServerPanic',
WebrpcInternalError = 'WebrpcInternalError',
WebrpcClientDisconnected = 'WebrpcClientDisconnected',
WebrpcClientAborted = 'WebrpcClientAborted',
WebrpcStreamLost = 'WebrpcStreamLost',
WebrpcStreamFinished = 'WebrpcStreamFinished',
Unauthorized = 'Unauthorized',
Expand All @@ -483,7 +483,7 @@ export enum WebrpcErrorCodes {
WebrpcBadResponse = -5,
WebrpcServerPanic = -6,
WebrpcInternalError = -7,
WebrpcClientDisconnected = -8,
WebrpcClientAborted = -8,
WebrpcStreamLost = -9,
WebrpcStreamFinished = -10,
Unauthorized = 1000,
Expand All @@ -503,7 +503,7 @@ export const webrpcErrorByCode: { [code: number]: any } = {
[-5]: WebrpcBadResponseError,
[-6]: WebrpcServerPanicError,
[-7]: WebrpcInternalErrorError,
[-8]: WebrpcClientDisconnectedError,
[-8]: WebrpcClientAbortedError,
[-9]: WebrpcStreamLostError,
[-10]: WebrpcStreamFinishedError,
[1000]: UnauthorizedError,
Expand Down
20 changes: 10 additions & 10 deletions _examples/sse/webapp/client.gen.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* eslint-disable */
// webrpc-sse-chat v1.0.0 a799dc63b082644f5d003c8881424546aee23a2c
// --
// Code generated by webrpc-gen@v0.24.0 with ../../ generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.26.1-2-g0e89de9 with ../../ generator. DO NOT EDIT.
//
// webrpc-gen -schema=service.ridl -target=../../ -client -out=./webapp/client.gen.ts

export const WebrpcHeader = "Webrpc"

export const WebrpcHeaderValue = "webrpc@v0.24.0;@unknown;webrpc-sse-chat@v1.0.0"
export const WebrpcHeaderValue = "webrpc@v0.26.1-2-g0e89de9;@unknown;webrpc-sse-chat@v1.0.0"

// WebRPC description and code-gen version
export const WebRPCVersion = "v1"
Expand Down Expand Up @@ -244,7 +244,7 @@ const sseResponse = async (

if (error instanceof DOMException && error.name === "AbortError") {
onError(
WebrpcRequestFailedError.new({
WebrpcClientAbortedError.new({
message: "AbortError",
cause: `AbortError: ${message}`,
}),
Expand Down Expand Up @@ -483,16 +483,16 @@ export class WebrpcInternalErrorError extends WebrpcError {
}
}

export class WebrpcClientDisconnectedError extends WebrpcError {
export class WebrpcClientAbortedError extends WebrpcError {
constructor(
name: string = 'WebrpcClientDisconnected',
name: string = 'WebrpcClientAborted',
code: number = -8,
message: string = `client disconnected`,
message: string = `request aborted by client`,
status: number = 0,
cause?: string
) {
super(name, code, message, status, cause)
Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype)
Object.setPrototypeOf(this, WebrpcClientAbortedError.prototype)
}
}

Expand Down Expand Up @@ -548,7 +548,7 @@ export enum errors {
WebrpcBadResponse = 'WebrpcBadResponse',
WebrpcServerPanic = 'WebrpcServerPanic',
WebrpcInternalError = 'WebrpcInternalError',
WebrpcClientDisconnected = 'WebrpcClientDisconnected',
WebrpcClientAborted = 'WebrpcClientAborted',
WebrpcStreamLost = 'WebrpcStreamLost',
WebrpcStreamFinished = 'WebrpcStreamFinished',
EmptyUsername = 'EmptyUsername',
Expand All @@ -563,7 +563,7 @@ export enum WebrpcErrorCodes {
WebrpcBadResponse = -5,
WebrpcServerPanic = -6,
WebrpcInternalError = -7,
WebrpcClientDisconnected = -8,
WebrpcClientAborted = -8,
WebrpcStreamLost = -9,
WebrpcStreamFinished = -10,
EmptyUsername = 100,
Expand All @@ -578,7 +578,7 @@ export const webrpcErrorByCode: { [code: number]: any } = {
[-5]: WebrpcBadResponseError,
[-6]: WebrpcServerPanicError,
[-7]: WebrpcInternalErrorError,
[-8]: WebrpcClientDisconnectedError,
[-8]: WebrpcClientAbortedError,
[-9]: WebrpcStreamLostError,
[-10]: WebrpcStreamFinishedError,
[100]: EmptyUsernameError,
Expand Down
2 changes: 1 addition & 1 deletion clientSSE.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const sseResponse = async (

if (error instanceof DOMException && error.name === "AbortError") {
onError(
WebrpcRequestFailedError.new({
WebrpcClientAbortedError.new({
message: "AbortError",
cause: `AbortError: ${message}`,
}),
Expand Down