OxL Справочник OxL
РусскийEnglish

data SessionError

Why a session could not be created or ended (the session store is the cluster's replicated key-value store).

Example:

oxl✓ проверяется в CI
use std.rpc { createSession, SessionError }
use std.time { Duration }

fn main() io, db {
  // a ttl of zero is outside 1 ms .. 30 days
  match createSession("u1", ["Admin"], Duration.ofMillis(0)) {
    str _ => print("created")
    SessionError e => print("refused")
  }
}
Вывод
refused
@error pub(api) data SessionError

С версии. 1.0.0-beta

Поля

pub(api) msg: str

Why the session store refused the call (for example a ttl outside 1 ms .. 30 days, or a store that cannot be reached).

Определено в: std/rpc/rpc.oxl:370

См. также