Error Handling
Prev | Chapter 2. Upgrading From PyOpenGL 1.5 | Next

## Error Handling

PyOpenGL 2 always uses "strict" OpenGL operation, which is closer to the operation of Python itself, i.e. errors are raised as exceptions, rather than silently being passed back to the user. `glGetError` is not available as it would never return anything save `GL_NO_ERROR`.

To convert, you will want to search for each instance of `glGetError` and introduce the appropriate exception handling mechanisms. The exceptions raised are:

- `GL.GLerror` by all modules except `WGL`
- `GLU.GLUerror` by some `GLU` functions. Note that `GLU` can also throw `GL.GLerror`
- `WindowsError`/`SystemError` by `WGL`

Prev | Home | Next
Chapter 2. Upgrading From PyOpenGL 1.5 | Up | `GL`