-
Notifications
You must be signed in to change notification settings - Fork 193
Better Errors for fs API #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
dan200
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment in thread
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be "/" + path + ": Invalid path" to be consistent with the others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forget it, sorry
|
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.