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.
| Code | Message |
|---|---|
ELEV_MISMATCH | The elevation data does not match the route: one height for each point of the route. |
TRACK_EMPTY | The route has fewer than 2 points, or its text is cut short. |
WIRE_TRUNCATED | The track file is cut short or malformed: a value runs past its section. |
WIRE_TRAILING | A section of the track file has bytes after its content. |
WIRE_VERSION | The track file has a format or a section version that this library does not read. Build the file again. |
WIRE_SECTION | The track file has a section that is unknown, repeated, empty or out of order. Build the file again. |
WIRE_ROUTE | The track file has no route section. Build the file again. |
WIRE_UNSUPPORTED | The track file cannot carry a field span with a texture ground. Use an atlas cell for the span. |
WIRE_ANIM | The track file holds animation. Animation moved to the scene module. Build the file again without it. |
WIRE_GLYPH_METRIC | A 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_DUPLICATE | The scene lists the same layer twice. |
LAYER_UNLISTED | The track declares a layer that the scene does not list. |
LAYER_MISSING | The scene lists a layer that the track does not declare. |
WEBGL_UNSUPPORTED | This browser gave no WebGL context for the canvas. |
SCENE_NO_TRACK | This scene draws an engine the page moves itself, so it takes no dynamic inputs: scene.draw({ … }) needs a track from loadTrack. |
SCENE_ATLAS | An atlas the scene names as a URL could not be fetched or decoded. |
LANE_COUNT | A lane span's lane count must be from 1 to 8. |
LANE_BOUNDS | A lane span has a bad range: 0 ≤ start < end ≤ track length. |
LANE_OVERLAP | Two lane spans overlap. |
LANE_TAPER | Two changes of road width are closer than the 30 m taper. |
LANE_DASH | A dashed divider needs dashOn and dashGap above 0. |
LANE_COLOR | A divider colour needs each part from 0 to 1. |
ROAD_CAPACITY | The track has more road quads in one frame than one draw can index. |
FIELD_RANGE | A field span has a bad range: 0 ≤ start < end. |
FIELD_END | A field span ends past the end of the track. |
FIELD_OVERLAP | Two field spans overlap on the same side. |
FIELD_ATLAS_CELL | A field span uses an atlas cell, but the track has no field atlas, or the cell block does not fit its grid. |
FIELD_ATLAS_DIMS | The 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_MISSING | The field layer has no image to draw from. |
FIELD_IMAGE_SIZE | A field tile image must be loaded, with power-of-two sides such as 256 × 256. |
FIELD_CAPACITY | The track has more field quads in one frame than one draw can index. |
SCENERY_ATLAS | The 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_SPRITE | A 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_ASSET | A scenery asset is bad: its cell is outside the grid, or its cell block does not fit the grid. |
SCENERY_PLACED | A placed object names an asset the track does not declare. |
SCENERY_OBJECT_SPRITE | An object uses a sprite that the track does not declare. |
SCENERY_OBJECT_S | An object is outside the track, or one of its positions is not a finite number. |
SCENERY_SCALE | An object's scale must be a finite number, 0 or more. 0 hides the object. |
SCENERY_ROTATION | An object's rotation must be a finite number. |
SCENERY_ORIGIN | An object's rotation origin must be on the card: each part from 0 to 1. |
SCENERY_ANIM | An object has an animate, oscillate or shape key. Animation moved to the scene module. |
SCENERY_CAPACITY | The track has more scenery quads than one draw can index. |
SCENERY_IMAGE_MISSING | The scenery layer has no image to draw from. |
TEXT_FONT | The font is bad: scaleW, scaleH and lineHeight are finite and above 0, and base is finite and 0 or more. |
TEXT_GLYPH | A glyph has a bad rectangle, a negative size, or an offset or advance that is not a finite number. |
TEXT_GLYPH_DUP | The font declares one glyph twice. |
TEXT_LABEL | A 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_S | A label is outside the track, or one of its positions is not a finite number. |
TEXT_CODEPOINT | A label has a character with no glyph in the font. |
TEXT_ANIM | A label has an animate or shape key. Animation moved to the scene module. |
TEXT_CAPACITY | The track has more glyph quads than one draw can index. |
TEXT_IMAGE_MISSING | The text layer has no image to draw from. |
TEXT_IMAGE_SIZE | The text atlas image must be loaded, with power-of-two sides such as 256 × 256. |
SCENE_HOST | The 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_POSITION | The scene declares no dynamic input named position. |
SCENE_KIND | An object's kind is not image(<asset>) or text("<string>"), or its arguments are not one asset or one string. |
SCENE_PROPERTY | An object does not declare exactly the properties its kind takes. |
SCENE_NAME | An out field of the scene is not camera_x or camera_y. |
SCENE_ASSET | An 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_TRACK | The 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_USING | A using input of the scene gets no value at load, or one that is not a finite number. |
SCENE_DYNAMIC | A dynamic input is missing from the draw call, or is not a finite number. |
SCENE_VALUE | A 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. |