Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jimdebeer committed Mar 25, 2023
1 parent 7571ee7 commit e6f2905
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
27 changes: 16 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@based/client",
"version": "4.0.3",
"version": "4.0.4",
"license": "MIT",
"main": "dist/index.js",
"scripts": {
Expand All @@ -24,7 +24,7 @@
]
},
"dependencies": {
"@based/opts": "0.0.10",
"@based/opts": "0.0.11",
"@saulx/diff": "^1.1.4",
"@saulx/hash": "^2.0.0",
"fflate": "^0.7.3",
Expand Down
6 changes: 6 additions & 0 deletions packages/client/src/types/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export const convertDataToBasedError = (
payload: BasedErrorData,
stack?: string
): BasedError => {
if (!payload || typeof payload !== 'object') {
const err = new BasedError(`Payload: ${payload}`)
err.code = BasedErrorCode.FunctionError
err.name = 'Invalid returned payload'
return err
}
const { message, code } = payload
const msg =
message[0] === '[' ? message : `[${BasedErrorCode[code]}] ` + message
Expand Down
3 changes: 2 additions & 1 deletion packages/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,9 @@ export class BasedServer {
}

async destroy() {
if (!this.silent)
if (!this.silent) {
console.info(picocolors.gray(` Destroy Based-server ${this.port} \n`))
}
if (this.listenSocket) {
uws.us_listen_socket_close(this.listenSocket)
this.listenSocket = null
Expand Down

0 comments on commit e6f2905

Please sign in to comment.