Skip to content

Improve error handling #151

Open
@tobiasdiez

Description

@tobiasdiez

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions