Closed IceNature closed 8 years ago
Does this really happen enough to be a problem? I mean, this function is not even called when there is no dub file, so it should only fail if the dub file is corrupted, and in that case I see no reason not to propagate the error to the user...
I agree with you. So How about change it to
echo "Can not get dub project import path!"
It removes the exception information and will not interrupt operation.
Seems reasonable. Usually I would insist that hiding rare error messages from the user is bad, since they are rare enough to not be a bother, but when they do happen the user should be aware of them so they can fix what's wrong.
In this case, though, the error will happen when the dub file is corrupted, and in that case the user will get the error when they try to build(and it will be formatted more nicely).
But you know, the error message which catched by try
in vim here makes no sense to user. Maybe a soft reminder is enough.
Catch the exception when dutyl can't get import path from dub. Now in any case, the
g:dutyl_stdImportPaths
will take effect.