Skip to content

Commit

Permalink
MatsimVehicleReader: provide more meaningful error message
Browse files Browse the repository at this point in the history
  • Loading branch information
tschlenther committed Jun 13, 2024
1 parent f056d03 commit 757d9d6
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ public void startTag(final String name, final Attributes atts, final Stack<Strin
throw new RuntimeException("no reader found for " + str ) ;
}
} else{
if (this.delegate == null) {
log.error("found no valid. vehicle definition file. this may happen if you try to parse a dvrp vehicles file for example or if no vehicle definition file is provided.\n" +
"Valid vehicle definitions are at http://www.matsim.org/files/dtd/vehicleDefinitions_v2.0.xsd and http://www.matsim.org/files/dtd/vehicleDefinitions_v1.0.xsd\n" +
"The code will crash with a NullPointerException.");
}
this.delegate.startTag( name, atts, context );
}
}
Expand Down

0 comments on commit 757d9d6

Please sign in to comment.