Expand Minimize

getError method

Returns a value for the WebGL error flag and clears the flag.

IE11

 

Syntax

var retVal = WebGLRenderingContext.getError();

Parameters

This method has no parameters.

Return value

Type: Number

Error code.

OUT_OF_MEMORY

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.

Remarks

No additional errors are recorded until this method is called. When you call getError, it returns the error code and resets the error flag.

See also

WebGLRenderingContext

 

 

Show:
© 2014 Microsoft