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.
Constants
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.
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.
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 methods
clip_not_representable?
Returns true if this enum value equals ClipNotRepresentable
Sourcedevice_error?
Returns true if this enum value equals DeviceError
Sourcedevice_finished?
Returns true if this enum value equals DeviceFinished
Sourcedevice_type_mismatch?
Returns true if this enum value equals DeviceTypeMismatch
Sourcefile_not_found?
Returns true if this enum value equals FileNotFound
Sourcefont_type_mismatch?
Returns true if this enum value equals FontTypeMismatch
Sourcefree_type_error?
Returns true if this enum value equals FreeTypeError
Sourceinvalid_clusters?
Returns true if this enum value equals InvalidClusters
Sourceinvalid_content?
Returns true if this enum value equals InvalidContent
Sourceinvalid_dash?
Returns true if this enum value equals InvalidDash
Sourceinvalid_index?
Returns true if this enum value equals InvalidIndex
Sourceinvalid_matrix?
Returns true if this enum value equals InvalidMatrix
Sourceinvalid_mesh_construction?
Returns true if this enum value equals InvalidMeshConstruction
Sourceinvalid_path_data?
Returns true if this enum value equals InvalidPathData
Sourceinvalid_pop_group?
Returns true if this enum value equals InvalidPopGroup
Sourceinvalid_restore?
Returns true if this enum value equals InvalidRestore
Sourceinvalid_size?
Returns true if this enum value equals InvalidSize
Sourceinvalid_slant?
Returns true if this enum value equals InvalidSlant
Sourceinvalid_status?
Returns true if this enum value equals InvalidStatus
Sourceinvalid_stride?
Returns true if this enum value equals InvalidStride
Sourceinvalid_string?
Returns true if this enum value equals InvalidString
Sourceinvalid_visual?
Returns true if this enum value equals InvalidVisual
Sourceinvalid_weight?
Returns true if this enum value equals InvalidWeight
Sourcejbig2_global_missing?
Returns true if this enum value equals Jbig2GlobalMissing
Sourcelast_status?
Returns true if this enum value equals LastStatus
Sourcenegative_count?
Returns true if this enum value equals NegativeCount
Sourceno_current_point?
Returns true if this enum value equals NoCurrentPoint
Sourceno_memory?
Returns true if this enum value equals NoMemory
Sourcenull_pointer?
Returns true if this enum value equals NullPointer
Sourcepattern_type_mismatch?
Returns true if this enum value equals PatternTypeMismatch
Sourcepng_error?
Returns true if this enum value equals PngError
Sourceread_error?
Returns true if this enum value equals ReadError
Sourcesuccess?
Returns true if this enum value equals Success
Sourcesurface_finished?
Returns true if this enum value equals SurfaceFinished
Sourcesurface_type_mismatch?
Returns true if this enum value equals SurfaceTypeMismatch
Sourcetag_error?
Returns true if this enum value equals TagError
Sourcetemp_file_rrror?
Returns true if this enum value equals TempFileRrror
Sourceto_string
Provides a human-readable description.
Sourceuser_font_error?
Returns true if this enum value equals UserFontError
Sourceuser_font_immutable?
Returns true if this enum value equals UserFontImmutable
Sourceuser_font_not_implemented?
Returns true if this enum value equals UserFontNotImplemented
Sourcewin32_gdi_error?
Returns true if this enum value equals Win32GdiError
Sourcewrite_error?
Returns true if this enum value equals WriteError
Source