未验证 提交 6d983ef7 编写于 作者: D Daniel Hritzkiv 提交者: GitHub

Throw Errors in WebGLRenderer

…instead of strings.
上级 dcf6a193
...@@ -215,11 +215,11 @@ function WebGLRenderer( parameters ) { ...@@ -215,11 +215,11 @@ function WebGLRenderer( parameters ) {
if ( _canvas.getContext( 'webgl' ) !== null ) { if ( _canvas.getContext( 'webgl' ) !== null ) {
throw 'Error creating WebGL context with your selected attributes.'; throw new Error( 'Error creating WebGL context with your selected attributes.' );
} else { } else {
throw 'Error creating WebGL context.'; throw new Error( 'Error creating WebGL context.' );
} }
...@@ -239,7 +239,7 @@ function WebGLRenderer( parameters ) { ...@@ -239,7 +239,7 @@ function WebGLRenderer( parameters ) {
} catch ( error ) { } catch ( error ) {
console.error( 'THREE.WebGLRenderer: ' + error ); console.error( 'THREE.WebGLRenderer: ' + error.message );
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册