Error Codes
Everything the Rule Repository, Audit and the MCP server report carries a control number: CE followed by five digits, such as CE10059. A control number is a permanent address for one failure. It is never reused or renumbered, so you can search your logs for it, write alerts on it, and quote it to Code Effects support.
This page explains how failures reach your application and your users, what to do in your endpoint, and the codes an IT team is most likely to meet. It also lists the ranges, so you can tell at a glance where a code comes from.
Three Kinds of Answer
Every repository request ends in one of three ways:
| Kind |
What it means |
Where it goes |
Control number shown to the user |
| Confirmation |
The action succeeded |
A normal answer; the client shows a short message that fades away |
No |
| Warning |
An expected refusal the user can act on: no permission, a record changed or deleted by someone else, a value that does not validate |
A normal answer (Success: false), never thrown, never logged by the library |
No |
| Error |
Something unexpected: a database failure, a configuration mistake, a defect |
Thrown to your code as a RepositoryException |
Yes, so the user can quote it |
A warning is not your problem to solve: it tells the user what to do ("Reload the page to continue", "Reopen it to see their change"). An error is: log it and look at it.
The Exceptions
All of them derive from CodeEffects.Rule.Common.RuleException, which carries the number in ControlNumber. The message never contains it, and is written so it can be shown.
| Exception |
Thrown by |
Carries |
RepositoryException |
Context.GetResponse(..), SyncSources(..), Reindex(..) |
ResponseJson: the finished answer for the browser, with a general message and the control number. SyncResult or ReindexResult: the complete result, successes included, when a sync or a reindex failed |
RepositoryPermissionException |
Context.GetResponse(..) |
A RepositoryException with CE10219: the user's permissions do not allow the request. Action names the permission; ResponseJson is a warning that also tells the client the user's current permissions, so its buttons update |
ConnectionException |
Any call that reaches the database |
CE19002 (the database failed), CE19003 (it timed out) or CE19004 (its schema is behind this release) |
RuleException |
Argument and configuration checks, Context.GetRules(..), CheckDatabase(..) |
The number and a message for developers |
Provider messages, server names and stack traces never reach the browser. They stay on the exception's InnerException, for your log.
What to Do in Your Endpoint
Catch the two repository exceptions, log them with your own logger, and return the answer they carry. The user then sees the repository's own message and, for an error, the control number:
try
{
return Results.Content(Context.GetResponse(config, dbProvider, requestJson), "application/json");
}
catch(RepositoryPermissionException ex)
{
// A refusal, not a failure: worth an audit entry
logger.LogWarning("Rule Repository refused {Action} to {User}: {Message}", ex.Action, config.CurrentUserId, ex.Message);
return Results.Content(ex.ResponseJson, "application/json");
}
catch(RepositoryException ex)
{
// The whole failure, inner exception included, for your log
logger.LogError(ex, "Rule Repository request failed: {ControlNumber}", ex.ControlNumber);
return Results.Content(ex.ResponseJson, "application/json");
}
If you let the exception go, your application's own error handling logs it and the endpoint returns HTTP 500; the user then sees a general "the call failed" message without a control number.
Errors that happen outside a request, in the source sync, a reindex or GetRules(..), are thrown to the code that called them. Catch RepositoryException around SyncSources(..) and Reindex(..), and read SyncResult or ReindexResult from it: every definition is processed, and the result says which ones failed and why. See Source Synchronization and Reindexing.
Retries
The library retries once, and only after a deadlock or a dropped connection, by re-running the whole unit of work in a new transaction. Everything else fails at once, is rolled back, and the user can try again. A wrong server name is deliberately not retried, so nobody waits through the connection timeout twice. Which database errors count as a deadlock, a dropped connection or a timeout is decided by the dialect of your database provider (IDialect.Classify).
The Codes You Are Most Likely to Meet
Setup and Configuration
| Code |
Meaning |
What to do |
| CE10053 |
The configuration passed is null |
Build a Configuration for every request |
| CE10054, CE10116 |
The database provider passed is null |
Create the provider at startup; see Connecting to the Database |
| CE10055 |
The request is not valid JSON |
Pass the body exactly as the client posted it |
| CE10056 |
The request is empty |
Check your endpoint reads the body |
| CE10057 |
A request type the browser may not send (one reserved for AI agents) |
Nothing to fix in your code; it is a refused request |
| CE10080 |
The configuration does not name the user |
Set CurrentUserId from the signed-in user on every request |
| CE10218 |
The permission set is not complete: a permission is granted without one it requires |
Fix the role's list; test it with Context.ValidatePermissions(config). See Permissions |
| CE10220 |
The library's own permission map is broken |
A defect in the library: report it to Code Effects |
| CE10060-CE10065 |
The user interface XML is unreadable or incomplete |
See User Interface Text, Languages and Themes |
The Database
| Code |
Meaning |
What to do |
| CE19002 |
The database could not be reached, or could not complete the statement |
Read the inner exception in your log: connection string, network, rights of the account |
| CE19003 |
The database did not answer in time |
Look for blocking or an overloaded server; the user can try again |
| CE19004 |
The database's schema is older than this release needs; the message names the scripts to run |
Run the update scripts; see Updating the Database |
| CE10201 |
The signing key in the SettingRecord table is damaged |
Delete the SigningKey row; a new key is made at once. See Security |
Requests
| Code |
Kind |
Meaning |
| CE10200 |
Warning |
The record no longer exists; someone else may have deleted it |
| CE10202 |
Warning |
The page's token expired or could not be verified; the user reloads the page |
| CE10204 |
Warning |
Someone else saved the record while the user had it open; nothing was saved |
| CE10205 |
Error |
The request is longer than RequestLimits.RequestLength |
| CE10206 |
Error |
The request carries more filters than RequestLimits.Filters |
| CE10207 |
Error |
A draft, test or template is longer than RequestLimits.PayloadLength |
| CE10208 |
Warning |
A test run sent for saving was not sealed by the server for this user |
| CE10209 |
Test result |
The test ran with status Error because too many test runs were under way at once (RequestLimits.TestRunsAtOnce); the user tries again. If it keeps happening, a method or a test method may not be returning, and the application needs a restart |
| CE10219 |
Warning |
The user's permissions do not allow the request (RepositoryPermissionException) |
| CE10221 |
Warning |
A user tried to approve a request they made themselves |
Source Synchronization and Reindexing
| Code |
Meaning |
| CE10059 |
One or more source definitions failed; the exception carries the full SyncResult |
| CE10050 |
A source definition is empty |
| CE10051 |
An alias is longer than 450 characters |
| CE10052 |
A type a definition names could not be loaded, and no TypeResolver was given |
| CE10067 |
The TypeResolver returned nothing for one or more types |
| CE10079 |
The source settings passed are null |
| CE10170 |
A Source XML <references> section names the same property path twice |
| CE10001-CE10041 |
A source definition could not be read or compared; the message names the node |
| CE10117 |
Reindex(..) was given an alias the repository does not have |
| CE10118 |
One or more source objects could not be reindexed; the exception carries the full ReindexResult |
Loading Rules for Evaluation
| Code |
Meaning |
| CE10256 |
No rule with a live version matches the query |
| CE10257 |
A rule calls rules that have no live version |
| CE10258 |
A live version holds no rule, or its definition cannot be read |
| CE10259 |
A rule asked for by ID or name does not exist, or has no live version |
| CE10260 |
The query is null |
Unexpected
| Code |
Meaning |
| CE19001 |
An unexpected error in code that is not Code Effects': the inner exception has the detail. If the stack trace points into Code Effects libraries, report it with the control number |
The Ranges
| Range |
Comes from |
| CE10001-CE10041 |
Reading and comparing source definitions |
| CE10050-CE10260 |
The Repository library: requests, sync, reindex, saves, tests, permissions, AI features, loading rules; also the MCP server's tools, which share the Repository's numbers |
| CE19001 |
Unexpected errors outside Code Effects code |
| CE19002-CE19004 |
The database connection layer |
The Rule Editor and the Rule Engine use their own codes: two letters and four digits, such as GH7417. A CE code is always from the Rule Repository, Audit, the MCP server or their database layer.
The Answer's Shape
For an IT team writing its own client tooling or monitoring, a repository answer is JSON with these members:
| Member |
Meaning |
Success |
false for a warning or an error |
NotificationType |
confirmation, warning or error |
Error |
The message to show, for a warning or an error |
ControlNumber |
The control number, for an error and for permission refusals |
Message |
A confirmation's message |
Type, ObjectType, Id |
Which request this answers |
Record, Records, TotalCount, Options |
The data asked for |