exception handling to decide if WebGL can be used or canvas is needed