Files
herolib/lib/core/base/session_error.v
Mahmoud Emad 10e27d2962 feat: add base module
- Add base module with context, session, and configurator.
- Implement session management and configuration loading/saving.
- Introduce error handling and logging mechanisms.
- Include template files for Lua scripts.
2024-12-25 13:31:03 +02:00

43 lines
751 B
V

module base
import freeflowuniverse.crystallib.data.ourtime
import freeflowuniverse.crystallib.core.texttools
pub struct ErrorArgs {
pub mut:
cat string
error string
errortype ErrorType
}
pub struct ErrorItem {
pub mut:
time ourtime.OurTime
cat string
error string
errortype ErrorType
session string // the unique name for the session
}
pub enum ErrorType {
uknown
value
}
pub fn (mut session Session) error(args_ ErrorArgs) !ErrorItem {
mut args := args_
args.cat = texttools.name_fix(args.cat)
mut l := ErrorItem{
cat: args.cat
error: args.error
errortype: args.errortype
time: ourtime.now()
session: session.name
}
// TODO: get string output and put to redis
return l
}