Reference

Error codes

Every fault the library raises at run time is a MovebyError with a stable code and a readable message. This table is the package's own ERROR_MESSAGES: the site reads it from the installed version when it builds, so it lists every code of that version and nothing else.

The engine, which is WebAssembly, returns only the code. moveby's JavaScript turns the code into the message, so no English text is stored inside the module, and you can show your own message for any code.

The moveby build command has its own diagnostics. They name the file, the code and a reading of the fault. The command's page shows their form.

This version has 63 codes.

CodeMessage
ELEV_MISMATCHThe elevation data does not match the route: one height for each point of the route.
TRACK_EMPTYThe route has fewer than 2 points, or its text is cut short.
WIRE_TRUNCATEDThe track file is cut short or malformed: a value runs past its section.
WIRE_TRAILINGA section of the track file has bytes after its content.
WIRE_VERSIONThe track file has a format or a section version that this library does not read. Build the file again.
WIRE_SECTIONThe track file has a section that is unknown, repeated, empty or out of order. Build the file again.
WIRE_ROUTEThe track file has no route section. Build the file again.
WIRE_UNSUPPORTEDThe track file cannot carry a field span with a texture ground. Use an atlas cell for the span.
WIRE_ANIMThe track file holds animation. Animation moved to the scene module. Build the file again without it.
WIRE_GLYPH_METRICA glyph of the font does not fit the track file: the atlas sides are powers of two, and each glyph rectangle is whole pixels.
LAYER_DUPLICATEThe scene lists the same layer twice.
LAYER_UNLISTEDThe track declares a layer that the scene does not list.
LAYER_MISSINGThe scene lists a layer that the track does not declare.
WEBGL_UNSUPPORTEDThis browser gave no WebGL context for the canvas.
SCENE_NO_TRACKThis scene draws an engine the page moves itself, so it takes no dynamic inputs: scene.draw({ … }) needs a track from loadTrack.
SCENE_ATLASAn atlas the scene names as a URL could not be fetched or decoded.
LANE_COUNTA lane span's lane count must be from 1 to 8.
LANE_BOUNDSA lane span has a bad range: 0 ≤ start < end ≤ track length.
LANE_OVERLAPTwo lane spans overlap.
LANE_TAPERTwo changes of road width are closer than the 30 m taper.
LANE_DASHA dashed divider needs dashOn and dashGap above 0.
LANE_COLORA divider colour needs each part from 0 to 1.
ROAD_CAPACITYThe track has more road quads in one frame than one draw can index.
FIELD_RANGEA field span has a bad range: 0 ≤ start < end.
FIELD_ENDA field span ends past the end of the track.
FIELD_OVERLAPTwo field spans overlap on the same side.
FIELD_ATLAS_CELLA field span uses an atlas cell, but the track has no field atlas, or the cell block does not fit its grid.
FIELD_ATLAS_DIMSThe field atlas grid is bad: cols and rows are at least 1, each pixel size is a whole number of cells, and the grid has at most 65,536 cells.
FIELD_IMAGE_MISSINGThe field layer has no image to draw from.
FIELD_IMAGE_SIZEA field tile image must be loaded, with power-of-two sides such as 256 × 256.
FIELD_CAPACITYThe track has more field quads in one frame than one draw can index.
SCENERY_ATLASThe scenery atlas grid is bad: cols and rows are at least 1, each pixel size is a whole number of cells, and the grid has at most 65,536 cells.
SCENERY_SPRITEA sprite is bad: its cell is outside the grid or declared twice, its cell block does not fit, or its size is not a positive finite number.
SCENERY_ASSETA scenery asset is bad: its cell is outside the grid, or its cell block does not fit the grid.
SCENERY_PLACEDA placed object names an asset the track does not declare.
SCENERY_OBJECT_SPRITEAn object uses a sprite that the track does not declare.
SCENERY_OBJECT_SAn object is outside the track, or one of its positions is not a finite number.
SCENERY_SCALEAn object's scale must be a finite number, 0 or more. 0 hides the object.
SCENERY_ROTATIONAn object's rotation must be a finite number.
SCENERY_ORIGINAn object's rotation origin must be on the card: each part from 0 to 1.
SCENERY_ANIMAn object has an animate, oscillate or shape key. Animation moved to the scene module.
SCENERY_CAPACITYThe track has more scenery quads than one draw can index.
SCENERY_IMAGE_MISSINGThe scenery layer has no image to draw from.
TEXT_FONTThe font is bad: scaleW, scaleH and lineHeight are finite and above 0, and base is finite and 0 or more.
TEXT_GLYPHA glyph has a bad rectangle, a negative size, or an offset or advance that is not a finite number.
TEXT_GLYPH_DUPThe font declares one glyph twice.
TEXT_LABELA label is bad: its height is a finite number, 0 or more (0 hides it), and each part of its colour is from 0 to 1.
TEXT_ROAD_SA label is outside the track, or one of its positions is not a finite number.
TEXT_CODEPOINTA label has a character with no glyph in the font.
TEXT_ANIMA label has an animate or shape key. Animation moved to the scene module.
TEXT_CAPACITYThe track has more glyph quads than one draw can index.
TEXT_IMAGE_MISSINGThe text layer has no image to draw from.
TEXT_IMAGE_SIZEThe text atlas image must be loaded, with power-of-two sides such as 256 × 256.
SCENE_HOSTThe scene module is not one this library reads: it has no moveby.host section of version 2, or that section is malformed. Build it again.
SCENE_POSITIONThe scene declares no dynamic input named position.
SCENE_KINDAn object's kind is not image(<asset>) or text("<string>"), or its arguments are not one asset or one string.
SCENE_PROPERTYAn object does not declare exactly the properties its kind takes.
SCENE_NAMEAn out field of the scene is not camera_x or camera_y.
SCENE_ASSETAn image does not bind an asset of the scene's moveby.asset group, or the page's asset records do not fit the scene.
SCENE_TRACKThe track file and the scene do not fit: the track holds placed rows of its own, or it lacks the atlas grid or the font that the scene needs. Build the track again beside the scene.
SCENE_USINGA using input of the scene gets no value at load, or one that is not a finite number.
SCENE_DYNAMICA dynamic input is missing from the draw call, or is not a finite number.
SCENE_VALUEA value from the scene is out of range: not finite, a size below 0, or an alpha, a pivot part or a colour part outside 0 to 1. It is never clamped: the frame is rejected as a whole.