toAppErrorCode function
Accepts any string so daemon-provided codes pass through. Use AppErrorCodes constants for the known set.
Implementation
String toAppErrorCode(
String? code, {
String fallback = AppErrorCodes.commandFailed,
}) {
if (code != null && code.isNotEmpty) return code;
return fallback;
}