Browse Source

OBJLoader now throws on invalid obj files

Samuel Carlsson 9 years ago
parent
commit
d62fbac8c3
1 changed files with 6 additions and 1 deletions
  1. 6 1
      examples/js/loaders/OBJLoader.js

+ 6 - 1
examples/js/loaders/OBJLoader.js

@@ -2,6 +2,11 @@
  * @author mrdoob / http://mrdoob.com/
  */
 
+THREE.ParseException = function(message) {
+   this.message = message;
+   this.name = "ParseException";
+}
+
 THREE.OBJLoader = function ( manager ) {
 
 	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
@@ -334,7 +339,7 @@ THREE.OBJLoader.prototype = {
 
 			} else {
 
-				// console.log( "THREE.OBJLoader: Unhandled line " + line );
+                throw new THREE.ParseException("Unexpected line: " + line);
 
 			}