enum Cairo::Status

Overview

Cairo uses a single status type to represent all kinds of errors. A status value of Success represents no error and has an integer value of zero. All other status values represent an error.

Cairo's error handling is designed to be easy to use and safe. All major cairo objects retain an error status internally which can be queried anytime by the users using status calls. In the mean time, it is safe to call all cairo functions normally even if the underlying object is in an error status. This means that no error handling code is required before or after each individual cairo function call.

Status is used to indicate errors that can occur when using Context. In some cases it is returned directly by functions. But when using Context, the last error, if any, is stored in the context and can be retrieved with Context#status.

New entries may be added in future versions. Use Status#to_string to get a human-readable representation of an error message.

Defined in:

cairo/status.cr

Enum Members

Success = 0

No error has occurred.

NoMemory = 1

Out of memory.

InvalidRestore = 2

Context#restore called without matching Context#save.

InvalidPopGroup = 3

No saved group to pop, i.e. Context#pop_group without matching Context#push_group.

NoCurrentPoint = 4

No current point defined.

InvalidMatrix = 5

Invalid matrix (not invertible).

InvalidStatus = 6

Invalid value for an input Status.

NullPointer = 7

NULL pointer.

InvalidString = 8

Input string not valid UTF-8.

InvalidPathData = 9

Input path data not valid.

ReadError = 10

Error while reading from input stream.

WriteError = 11

Error while writing to output stream.

SurfaceFinished = 12

Target surface has been finished.

SurfaceTypeMismatch = 13

The surface type is not appropriate for the operation.

PatternTypeMismatch = 14

The pattern type is not appropriate for the operation.

InvalidContent = 15

Invalid value for an input Content.

InvalidFormat = 16

Invalid value for an input Format.

InvalidVisual = 17

Invalid value for an input Visual.

FileNotFound = 18

File not found.

InvalidDash = 19

Invalid value for a dash setting.

InvalidDscComment = 20

Invalid value for a DSC comment.

InvalidIndex = 21

Invalid index passed to getter.

ClipNotRepresentable = 22

Clip region not representable in desired format.

TempFileRrror = 23

Error creating or writing to a temporary file.

InvalidStride = 24

Invalid value for stride.

FontTypeMismatch = 25

The font type is not appropriate for the operation.

UserFontImmutable = 26

The user-font is immutable.

UserFontError = 27

Error occurred in a user-font callback function.

NegativeCount = 28

Negative number used where it is not allowed.

InvalidClusters = 29

Input clusters do not represent the accompanying text and glyph array.

InvalidSlant = 30

Invalid value for an input FontSlant.

InvalidWeight = 31

Invalid value for an input FontWeight.

InvalidSize = 32

Invalid value (typically too big) for the size of the input (surface, pattern, etc.).

UserFontNotImplemented = 33

User-font method not implemented.

DeviceTypeMismatch = 34

The device type is not appropriate for the operation.

DeviceError = 35

An operation to the device caused an unspecified error.

InvalidMeshConstruction = 36

A mesh pattern construction operation was used outside of a Pattern#begin_patch/Pattern#end_patch pair.

DeviceFinished = 37

Target device has been finished.

Jbig2GlobalMissing = 38

Cairo::C::LibCairo::MIME_TYPE_JBIG2_GLOBAL_ID has been used on at least one image but no image provided Cairo::C::LibCairo::MIME_TYPE_JBIG2_GLOBAL.

PngError = 39

Error occurred in libpng while reading from or writing to a PNG file.

FreeTypeError = 40

Error occurred in libfreetype.

Win32GdiError = 41

Error occurred in the Windows Graphics Device Interface.

TagError = 42

Invalid tag name, attributes, or nesting.

LastStatus = 43

This is a special value indicating the number of status values defined in this enumeration. When using this value, NOTE that the version of cairo at run-time may have additional status values defined than the value of this symbol at compile-time.

Instance Method Summary

Instance Method Detail

def clip_not_representable? #

[View source]
def device_error? #

[View source]
def device_finished? #

[View source]
def device_type_mismatch? #

[View source]
def file_not_found? #

[View source]
def font_type_mismatch? #

[View source]
def free_type_error? #

[View source]
def invalid_clusters? #

[View source]
def invalid_content? #

[View source]
def invalid_dash? #

[View source]
def invalid_dsc_comment? #

[View source]
def invalid_format? #

[View source]
def invalid_index? #

[View source]
def invalid_matrix? #

[View source]
def invalid_mesh_construction? #

[View source]
def invalid_path_data? #

[View source]
def invalid_pop_group? #

[View source]
def invalid_restore? #

[View source]
def invalid_size? #

[View source]
def invalid_slant? #

[View source]
def invalid_status? #

[View source]
def invalid_stride? #

[View source]
def invalid_string? #

[View source]
def invalid_visual? #

[View source]
def invalid_weight? #

[View source]
def jbig2_global_missing? #

[View source]
def last_status? #

[View source]
def negative_count? #

[View source]
def no_current_point? #

[View source]
def no_memory? #

[View source]
def null_pointer? #

[View source]
def pattern_type_mismatch? #

[View source]
def png_error? #

[View source]
def read_error? #

[View source]
def success? #

[View source]
def surface_finished? #

[View source]
def surface_type_mismatch? #

[View source]
def tag_error? #

[View source]
def temp_file_rrror? #

[View source]
def to_string : String #

Provides a human-readable description.


[View source]
def user_font_error? #

[View source]
def user_font_immutable? #

[View source]
def user_font_not_implemented? #

[View source]
def win32_gdi_error? #

[View source]
def write_error? #

[View source]