Better Errors for fs API#377
Conversation
|
I'm not Sure this current syntax reads Great, maybe a Couple of alternatives:
|
|
Agree with SquidDev: including the path is good, but need better strings |
|
Error string suggestion: |
|
@dan200 I had updated the messages to a new style |
|
The new format is similar to Vanilla Lua while still being clear that |
| if( match == null ) | ||
| { | ||
| throw new FileSystemException( "Invalid Path" ); | ||
| throw new FileSystemException( "Invalid Path (" + path + ")" ); |
There was a problem hiding this comment.
Shouldn't this be "/" + path + ": Invalid path" to be consistent with the others?
|
Don't repeat yourself; that should probably be a function: static String formatFSError( String path, String message )
{
return String.format( "/%s: %s", path, message );
}It's cleaner code, and that'll let us switch the format more easily if needed. |
|
Is this really such big thing that it should require its own function? |
|
@Wojbie I suppose it's a matter of taste. Coming from functional programming, I'm a fan of generalising as much as possible. |
|
I think, dan200 should decide, if we add a function for this. |

The Errors of the fs API now contain the Path.