Debug.error
luastra/debugDebug.error(...: any): nil
Emits an error-level diagnostic without replacing structured application error handling or automatically terminating execution. The message is intended for developers observing a failing operation.
Before you use it
Add luastra/debug to this module's dependencies in luastra.json, then import it with require("luastra/debug"). No additional host capability is required. Keep user-visible errors in UI state rather than relying on a developer console.
How it fits
The call writes a synchronous development diagnostic. It neither changes application state nor throws merely because the error log level is used.
When to use it
Use Debug.error when an operation reaches a failure branch that should be conspicuous during development. Still update user-visible state and handle the Result or resolve failure explicitly; do not use logging as control flow.
Parameters
| Parameter | Type / values | Description |
|---|---|---|
| ... | any | Checked ... argument accepted by Debug.error. |
Returns
nil — the exact nil value declared by the SDK contract.
What happens next
A prefixed diagnostic appears in the active host's development log.
Failures and fixes
Never include secrets or personal data. Logging is not telemetry, recovery, or user-facing error handling, and host presentation may differ.
Availability
Public-source alpha diagnostic API in 0.5.0-alpha.
Focused example
local Debug = require("luastra/debug")
Debug.error("server", "request failed")