Repository navigation
EN Runtime Errors and Logging
Andrewkydev edited this page Aug 25, 2026
·
1 revision
Русский: RU-Runtime-Errors-and-Logging
App.Start(ctx):
- rejects concurrent starts;
- freezes the plugin snapshot and loads settings;
- applies configured migrations;
- starts plugins;
- passes event subscriptions and command prefixes to adapters;
- starts adapters concurrently;
- retries a failed adapter with a 1–30 second backoff;
- stops plugins in reverse order when canceled.
A handler panic is converted into a typed internal error and logged with its stack trace. The common recovery mechanism does not cover panics inside platform goroutines.
invalid_argument, not_found, unauthorized, forbidden, conflict, unavailable, rate_limited, unsupported, canceled, deadline_exceeded, internal.
Use errors.CodeOf, IsCode, IsRetryable, and PublicMessage. Do not return a wrapped cause to an external client.
stream := logging.NewStream(256)
logger := logging.New(logging.Config{
Level: slog.LevelInfo,
Format: logging.FormatJSON,
Stream: stream,
})
app.SetLogger(logger)Each handler receives an event-scoped logger through ctx.Log().
runtime.Scheduler runs fixed-interval jobs until cancellation. runtime.WorkerPool limits concurrency. Neither recovers from a job panic; recovery must be implemented inside the task.