@m-ld/m-ld-spec
Version:
m-ld Protocol Specification
107 lines (106 loc) • 4.97 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MeldErrorStatus = void 0;
// noinspection JSUnusedGlobalSymbols
/**
* Errors that occur in a **m-ld** engine should be signalled with the given
* error codes where appropriate. The means by which errors are signalled is
* platform-specific.
*/
var MeldErrorStatus;
(function (MeldErrorStatus) {
/**
* No error has occurred.
*/
MeldErrorStatus[MeldErrorStatus["No error"] = 0] = "No error";
//////////////////////////////////////////////////////////////////////////////
// Bad request errors
/**
* A **json-rql** pattern has been specified that neither reads nor writes
* data, for example a Group with variable content.
*/
MeldErrorStatus[MeldErrorStatus["Pattern is not read or writeable"] = 4001] = "Pattern is not read or writeable";
/**
* The requested transaction results in a delta that is too large to transmit
* using the current message publishing implementation.
*/
MeldErrorStatus[MeldErrorStatus["Delta too big"] = 4002] = "Delta too big";
//////////////////////////////////////////////////////////////////////////////
// Unauthorised error
/**
* A request was made for data for which the current security principal does
* not have access rights.
*/
MeldErrorStatus[MeldErrorStatus["Unauthorised"] = 4030] = "Unauthorised";
//////////////////////////////////////////////////////////////////////////////
// Not found error
/**
* A request was made for updates in the too-distant past. This can occur when
* following clone updates, or when re-starting a clone that has been offline
* for too long.
*/
MeldErrorStatus[MeldErrorStatus["Updates unavailable"] = 4041] = "Updates unavailable";
//////////////////////////////////////////////////////////////////////////////
// Internal errors
/**
* A serious error has occurred in the engine implementation.
*/
MeldErrorStatus[MeldErrorStatus["Unknown error"] = 5000] = "Unknown error";
/**
* The engine has received an update that it cannot parse. This may be due to
* a version inconsistency, or a bad actor.
*/
MeldErrorStatus[MeldErrorStatus["Bad update"] = 5001] = "Bad update";
/**
* The engine has received a response that it cannot parse. This may be due
* to a version inconsistency, or a bad actor.
*/
MeldErrorStatus[MeldErrorStatus["Bad response"] = 5002] = "Bad response";
/**
* The engine has received a rejection from another engine on the domain to
* one of its requests. This could lead to the clone failing to initialise, or
* shutting down shortly after initialisation.
*/
MeldErrorStatus[MeldErrorStatus["Request rejected"] = 5003] = "Request rejected";
/**
* The engine has attempted an operation that requires other clones to be
* visible. This indicates a concurrency problem in the engine.
*/
MeldErrorStatus[MeldErrorStatus["Meld is offline"] = 5004] = "Meld is offline";
/**
* An update from another clone has arrived out-of-order, and the clone has
* not been able to recover. This indicates a concurrency problem in the
* engine.
*/
MeldErrorStatus[MeldErrorStatus["Update out of order"] = 5005] = "Update out of order";
//////////////////////////////////////////////////////////////////////////////
// Unsupported operations
/**
* The engine does not support the pattern in the transaction request.
*/
MeldErrorStatus[MeldErrorStatus["Unsupported pattern"] = 5011] = "Unsupported pattern";
//////////////////////////////////////////////////////////////////////////////
// Service unavailable
/**
* This is a new clone on the domain, but no other clones are visible,
* possibly due to a network partition. The clone cannot initialise.
*/
MeldErrorStatus[MeldErrorStatus["No visible clones"] = 5031] = "No visible clones";
/**
* This clone has been closed, explicitly by the app or due to an error. All
* subsequent transactions will fail.
*/
MeldErrorStatus[MeldErrorStatus["Clone has closed"] = 5032] = "Clone has closed";
/**
* The clone data is not writeable due to a platform limitation such as file
* locking, or concurrent access controls.
*/
MeldErrorStatus[MeldErrorStatus["Clone data is locked"] = 5034] = "Clone data is locked";
/**
* The clone's data is out of date and no other clones have kept sufficient
* information to recover it. The app could re-try initialising the clone
* later if, for example, the architecture includes a clone which keeps a long
* history, but it is currently unavailable.
*/
MeldErrorStatus[MeldErrorStatus["Clone outdated"] = 5035] = "Clone outdated";
})(MeldErrorStatus = exports.MeldErrorStatus || (exports.MeldErrorStatus = {}));