Improve error handling #151
Labels
p3: minor
For example an edge case that only affects very specific usage
type: developer experience
type: enhancement
Improving upon an existing feature
Right now errors are caught in the word-api and void is returned; but the void case is almost always not handled by the caller. Catching the exception makes sense only if there is a sensible value we can return in case there is an error. According to https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-error-handling most errors returned seem quite exceptional and there is no sensible way to recover (e.g InactiveWorkbook, ApiNotAvailable, ...). In these cases it would be better to let the error bubble upwards and add one central handler that converts the error code to a sensible user-facing error message. Adding some form of exception handler in the word-api makes sense if a certain error is kind of expected (maybe InvalidSelection) and one can recover from this.
The text was updated successfully, but these errors were encountered: