cairo-error-status {RGtk2} | R Documentation

## Error handling

### Description

Decoding cairo's status

### Methods and Functions

`cairoStatusToString(status)`

### Detailed Description

Cairo uses a single status type to represent all kinds of errors. A status value of `CAIRO_STATUS_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 cairo*`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.

### Enums and Flags

`CairoStatus`

  `CairoStatus` is used to indicate errors that can occur when using Cairo. In some cases it is returned directly by functions. but when using `Cairo`, the last error, if any, is stored in the context and can be retrieved with `cairoStatus`.

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

  `success`

    no error has occurred

  `no-memory`

    out of memory

  `invalid-restore`

    `cairoRestore` called without matching `cairoSave`

  `invalid-pop-group`

    no saved group to pop

  `no-current-point`

    no current point defined

  `invalid-matrix`

    invalid matrix (not invertible)

  `invalid-status`

    invalid value for an input `CairoStatus`

  `null-pointer`

    `NULL` pointer

  `invalid-string`

    input string not valid UTF-8

  `invalid-path-data`

    input path data not valid

  `read-error`

    error while reading from input stream

  `write-error`

    error while writing to output stream

  `surface-finished`

    target surface has been finished

  `surface-type-mismatch`

    the surface type is not appropriate for the operation

  `pattern-type-mismatch`

    the pattern type is not appropriate for the operation

  `invalid-content`

    invalid value for an input `CairoContent`

  `invalid-format`

    invalid value for an input `CairoFormat`

  `invalid-visual`

    invalid value for an input Visual*

  `file-not-found`

    file not found

  `invalid-dash`

    invalid value for a dash setting

  `invalid-dsc-comment`

    invalid value for a DSC comment (Since 1.2)

  `invalid-index`

    invalid index passed to getter (Since 1.4)

  `clip-not-representable`

    clip region not representable in desired format (Since 1.4)

### Author(s)

Derived by RGtkGen from GTK+ documentation

### References

https://www.cairographics.org/manual/cairo-Error-handling.html

[Package RGtk2 version 2.20.36.3 Index]