Returns a value for the WebGL error flag and clears the flag.
Syntaxvar retVal = WebGLRenderingContext.getError();
This method has no parameters.
The command requires more memory than is available. After this error is reported, the state of the WebGL context is undefined except for error flags.INVALID_ENUM
An unacceptable value for an enumerated argument was specified.INVALID_OPERATION
The specified operation isn't allowed for the current state. The command is ignored.INVALID_FRAMEBUFFER_OPERATION
The command is attempting to read or render from a framebuffer that is not framebuffer complete. A call to checkFramebufferStatus doesn't return gl.FRAMEBUFFER_COMPLETE.INVALID_VALUE
A number that was passed is out of range. The unacceptable value is ignored.CONTEXT_LOST_WEBGL
If WebGL context is lost, this error is returned on the first call to getError. Subsequent calls return NO_ERROR until context is restored.NO_ERROR
No error has been recorded. This can occur if getError has been called previously, and continues until the error has been corrected.
No additional errors are recorded until this method is called. When you call getError, it returns the error code and resets the error flag.