Error Types

Error Types — Load time and runtime errors

Synopsis

#include <cattle/cattle.h>

enum                CattleError;
#define             CATTLE_ERROR

Description

Cattle uses the facilities provided by GLib for error reporting.

Functions that can fail take a GError as last argument; errors raised are in the CATTLE_ERROR domain with error codes from the CattleError enumeration.

Details

enum CattleError

typedef enum {
	CATTLE_ERROR_BAD_UTF8,
	CATTLE_ERROR_IO,
	CATTLE_ERROR_UNBALANCED_BRACKETS,
	CATTLE_ERROR_INPUT_OUT_OF_RANGE
} CattleError;

Errors detected either on code loading or at runtime.

Cattle only supports UTF-8, so any input not using this encoding causes an error to be raised.

CATTLE_ERROR_BAD_UTF8

The provided input is not valid UTF-8

CATTLE_ERROR_IO

Generic I/O error

CATTLE_ERROR_UNBALANCED_BRACKETS

The number of open and closed brackets don't match

CATTLE_ERROR_INPUT_OUT_OF_RANGE

The input cannot be stored in a tape cell

CATTLE_ERROR

#define CATTLE_ERROR cattle_error_quark()

Error domain for Cattle. Errors in this domain will be from the CattleError enumeration.