Skip to content

Error handling ​

This page describes how errors are reported by the public GraphQL API and how to handle the most common failure cases across the upload, analysis, and scoring workflows.

Typed mutation errors ​

Mutations do not return GraphQL errors for expected business failures specific to that mutation, such as a container that doesn't exist or is already being analyzed. Instead, each mutation returns a union of a success result and one or more typed error results, so your client can branch on a code field instead of parsing error strings.

For example, scoreContainer returns a ScoreContainerOutput, which is either a ScoreContainerResult or a ScoreContainerError. Always select both branches:

graphql
mutation ScoreContainer($input: ScoreContainerInput!) {
  scoreContainer(input: $input) {
    ... on ScoreContainerResult {
      score
    }
    ... on ScoreContainerError {
      code
      message
    }
  }
}

An unexpected/internal failure (not something your input can cause) is still returned as a regular top-level GraphQL error.

Standard errors ​

A fixed set of cross-cutting failures — missing permission, insufficient credit, and invalid input — is common to virtually every mutation (and to some queries too). Unlike the failures above, these are never part of a mutation's typed union, no matter which operation triggered them: they are always returned as a regular top-level GraphQL error, with a code in the error's extensions:

json
{
  "errors": [
    {
      "message": "Missing permission",
      "extensions": { "code": "MISSING_PERMISSION" }
    }
  ]
}
CodeMeaning
MISSING_PERMISSIONYour account does not have permission to perform this operation on the given resource.
INSUFFICIENT_CREDITSThe workspace does not have enough credits for this operation.
GRAPHQL_VALIDATION_FAILEDThe input failed validation (also used for malformed request bodies). extensions.err carries the validation detail.
RESOURCE_NOT_FOUNDA referenced resource does not exist, or you do not have access to it.
QUERY_COMPLEXITY_EXCEEDEDThe request was rejected for being too expensive to execute; simplify or split it into smaller requests.
INTERNAL_SERVER_ERRORAn unexpected failure on our end, not something your input can fix.

Because these codes are identical across every operation, a single generic handler in your client (e.g. redirect on MISSING_PERMISSION, prompt a credit top-up on INSUFFICIENT_CREDITS) covers all of them, instead of branching per mutation the way you do for typed mutation errors.

Idempotency ​

Some mutations are not idempotent. Calling them multiple times for the same resource can create duplicate data or trigger unexpected side effects.

  • uploadContainer is not idempotent. Do not call it multiple times for the same upload unless you are explicitly retrying after a failure.

Retry behavior ​

Retry behavior depends on the mutation and the state of the resource:

  • Upload: if an upload is interrupted, only the missing parts need to be uploaded again. If container extraction fails, verify that every part was uploaded and that the multipart upload was finalized successfully, then call uploadContainer again to restart extraction.
  • Analysis: calling analyseContainer on a container that is already being analyzed, or has already been analyzed, is ignored — the API does not start a new analysis process in this case.
  • Scoring: scoreContainer can be called multiple times for the same container, for example to compare scores across different templates. Each scoring request is processed independently.

Common error codes ​

createUpload ​

Error codeDescription
notFoundThe upload could not be found.

finalizeUpload ​

Error codeDescription
notFoundThe upload was not found.

uploadContainer ​

Error codeDescription
uploadMaxSizeExceededThe uploaded file exceeds the maximum workspace available size.
folderNotFoundThe destination folder does not exist.
depositNotFoundThe referenced deposit does not exist.

analyseContainer ​

Error codeDescription
alreadyInProgressThe container is already being analyzed.

scoreContainer ​

Error codeDescription
containerNotFoundThe specified container does not exist.
containerNotAnalyzedThe container has not been analyzed yet or does not have the required analysis level.
missingVideoStreamThe container does not contain any video stream.
templateNotFoundThe specified scoring template does not exist.

createMontageFromContainer ​

Error codeDescription
containerNotAnalyzedAt least one stream of the container has not been successfully analyzed.
missingVideoStreamThe container does not contain any video stream, e.g. an audio-only file.

updateMontage ​

Error codeDescription
MontageIsLockedThe montage is locked. Only the creator of a locked montage can still update it.

renderMontages and renderMontageFromSettings ​

Error codeDescription
presetNotAvailableA preset is not available for the montage you are rendering.
invalidRenditionParamsA preset's settings are not valid for the montage's content.

Best practices ​

  • Always select both branches of a mutation's output union (...Result and ...Error) so you can handle typed errors without relying on GraphQL-level errors.
  • Always check the status of a container (uploadStatus) before triggering the next step in the workflow (analysis, scoring). See Event handling for the full list of status values.
  • Verify that a container has been analyzed with a sufficient manifestLevel (at least L) before attempting to score it.
  • Make sure the container contains a video stream before scoring it.
  • Treat non-idempotent mutations, such as uploadContainer, with care to avoid duplicate processing.