idanarye / vim-dutyl

Coordinate D tools to work together for you
http://www.vim.org/scripts/script.php?script_id=5003
79 stars 13 forks source link

Fix: When dutyl call dub failed, dcd can't get the import path in g:dutyl_stdImportPaths #30

Closed IceNature closed 8 years ago

IceNature commented 8 years ago

Catch the exception when dutyl can't get import path from dub. Now in any case, the g:dutyl_stdImportPaths will take effect.

idanarye commented 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...

IceNature commented 8 years ago

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.

idanarye commented 8 years ago

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).

IceNature commented 8 years ago

But you know, the error message which catched by try in vim here makes no sense to user. Maybe a soft reminder is enough.