Semantic-Org/Semantic-UI · warning
API Request Aborted. Exit conditions met
Error message
API Request Aborted. Exit conditions met
What it means
This error message is defined in the API module's settings.error dictionary for the 'exitConditions' key. It represents a request that was aborted because exit conditions were met — the module determined that the request should not proceed based on pre-flight checks. While not directly referenced by a module.error() call in the current source version, it exists as part of the error vocabulary for request cancellation scenarios.
Source
Thrown at src/definitions/behaviors/api.js:1129
// request finished without aborting
onComplete : function(response, $module) {},
// failed JSON success test
onFailure : function(response, $module) {},
// server error
onError : function(errorMessage, $module) {},
// request aborted
onAbort : function(errorMessage, $module) {},
successTest : false,
// errors
error : {
beforeSend : 'The before send function has aborted the request',
error : 'There was an error with your request',
exitConditions : 'API Request Aborted. Exit conditions met',
JSONParse : 'JSON could not be parsed during error handling',
legacyParameters : 'You are using legacy API success callback names',
method : 'The method you called is not defined',
missingAction : 'API action used but no url was defined',
missingSerialize : 'jquery-serialize-object is required to add form data to an existing data object',
missingURL : 'No URL specified for api event',
noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
noStorage : 'Caching responses locally requires session storage',
parseError : 'There was an error parsing your request',
requiredParameter : 'Missing a required URL parameter: ',
statusMessage : 'Server gave an error: ',
timeout : 'Your request timed out'
},
regExp : {
required : /\{\$*[A-z0-9]+\}/g,
optional : /\{\/\$*[A-z0-9]+\}/g,
},View on GitHub (pinned to 597843ab84)
Solutions
- Enable settings.interruptRequests: true if you want subsequent requests to supersede pending ones.
- Prevent API events from firing on disabled elements by checking element state before calling query.
- If using mock responses, ensure the mock responder returns a truthy value for valid responses.
Example fix
// before
$('.btn').api({
url: '/api/submit',
interruptRequests: false // second click silently fails
});
// after
$('.btn').api({
url: '/api/submit',
interruptRequests: true,
throttle: 1000
}); Defensive patterns
Strategy: validation
Validate before calling
// Check exit conditions before firing the API request
if (!$('.el').prop('disabled') && !$('.el').hasClass('loading')) {
$('.el').api('query');
} else {
console.log('Request skipped: exit conditions met.');
} Type guard
// Check whether the element is in a state that allows API requests
function canRequest($el) {
return !$el.prop('disabled') && !$el.hasClass('loading');
} Prevention
- Set interruptRequests: true if you need the latest request to supersede pending ones.
- Disable the triggering element during the request to prevent duplicate submissions.
- Use throttle settings to rate-limit rapid-fire requests.
When it happens
Trigger: A request is aborted during the query phase because one or more exit conditions are met — such as the element being disabled (module.is.disabled()), a previous request still loading without interruptRequests enabled, or mock mode rejecting the response.
Common situations: Double-submit prevention where a second request fires while the first is pending and interruptRequests is not set. Disabled elements triggering API calls via event bindings. Mock response functions returning falsy values to simulate failures.
Related errors
- The before send function has aborted the request
- There was an error with your request
- JSON could not be parsed during error handling
- You are using legacy API success callback names
- The method you called is not defined
AI-assisted analysis of Semantic-Org/Semantic-UI@597843ab84 (2026-08-13).
Data as JSON: /api/errors/01e25dc1ab6fe570.
Report an issue: GitHub.