RESTClientErrorResult
property RESTClientErrorResult: Integer read write;
Example
procedure ScriptEvent(var Value: Variant);
begin
Value := Action.RESTClientErrorResult;
end;
Usage
RESTClientErrorResult controls the HTTP status code selected for configured client-error outcomes of an API flow.
Behaviour
A script assignment changes the live status policy that the waiting REST manager reads after execution. It does not immediately set Response, send an HTTP response, mark the log as error or persist configuration.
Use a valid 4xx code that accurately describes caller-correctable failure. Do not use this property to hide authentication/authorisation failures or unexpected Velox errors, and do not include sensitive diagnostics in the associated response body.
Additional Technical Info
RESTClientErrorResult is the Integer status code the REST manager selects for action outcomes it classifies as client errors.
The new-action default is 400 (Bad Request). Loaded configuration or a script can supply another integer.
Implementation
After the action thread finishes without a fatal exception, the REST manager examines the action log's last status type. For POST, both issue and error select this property. For GET, only error selects it; issue falls through to RESTSuccessResult.
The property is a direct field. Its setter does not validate the HTTP range, registered meaning or consistency with the outcome category.
Edge cases and quirks
- GET and POST deliberately differ for issue status in the current implementation.
- Warning, duplicate and cancelled statuses do not select this property; they fall through to success mapping.
- A fatal action-thread exception uses
RESTServerErrorResult, not this field. - Timeout or missing-action paths use a fixed 500 and do not consult the configured result fields.
- Any Integer is accepted by the action object; an invalid/unassigned HTTP code can fail or behave unexpectedly in the web layer.
Performance and concurrency
Access is constant-time. Change it only within the current bounded API execution or through reviewed configuration; concurrent mutation can race with the REST manager's post-execution read.
Related entries
RESTSuccessResultandRESTServerErrorResult— other outcome mappings.REST— API context flag.Response— outgoing object.
External references
Created 2026-07-15