• TypeScript 88.3%
  • JavaScript 11.7%
Find a file
2026-01-28 15:03:52 +01:00
.vscode Add prettier and formatter, make code style consistent, sort package.json 2026-01-28 15:03:52 +01:00
src Add prettier and formatter, make code style consistent, sort package.json 2026-01-28 15:03:52 +01:00
.gitignore Initial commit 2024-06-20 20:10:35 +04:00
.prettierignore Add prettier and formatter, make code style consistent, sort package.json 2026-01-28 15:03:52 +01:00
.prettierrc Add prettier and formatter, make code style consistent, sort package.json 2026-01-28 15:03:52 +01:00
bun.lock Add prettier and formatter, make code style consistent, sort package.json 2026-01-28 15:03:52 +01:00
eslint.config.js Add prettier and formatter, make code style consistent, sort package.json 2026-01-28 15:03:52 +01:00
LICENSE Add prettier and formatter, make code style consistent, sort package.json 2026-01-28 15:03:52 +01:00
package.json Add prettier and formatter, make code style consistent, sort package.json 2026-01-28 15:03:52 +01:00
README.md Add prettier and formatter, make code style consistent, sort package.json 2026-01-28 15:03:52 +01:00
tsconfig.build.json Add prettier and formatter, make code style consistent, sort package.json 2026-01-28 15:03:52 +01:00
tsconfig.json Add prettier and formatter, make code style consistent, sort package.json 2026-01-28 15:03:52 +01:00

@session.js/errors

Session.js error classes. This module can be used to check instance of thrown errors in Session.js. All errors extend from SessionJsError class which itself extends from generic Error class.

import { SessionRuntimeError, SessionJsError } from '@session.js/error'

try {
  // something throws
} catch(e) {
  if(e instanceof SessionRuntimeError) {
    console.error('Session.js runtime error handled')
  } else {
    if(e instanceof SessionJsError) {
      console.error('It\'s not Session.js runtime error... but at least we know it\'s Session\.js error')
    } else {
      console.error('No idea what is this error')
      throw e
    }
  }
}

Made for Session.js

Use Session messenger programmatically with Session.js: Session bots, custom Session clients, and more.

Donate

hloth.dev/donate · Tor: hlothdevzkti6suoksy7lcy7hmpxnr3msu5waokzaslsi2mnx5ouu4qd.onion/donate

License

MIT