solid-software / languagetool_textfield

🌐 Flutter text field that implements LanguageTool spellcheck.
BSD 3-Clause "New" or "Revised" License
34 stars 10 forks source link

Exceptions thrown by the `language_tool` are not handled #37

Closed mitryp closed 1 year ago

mitryp commented 1 year ago

The language_tool package does not handle the HTTP exceptions, so when they occur, the program crashes.

Exception on providing a misspelled language code:

Error: Exception: http.post error: 400 
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 288:49  throw_
packages/language_tool/src/language_tool.dart 53:7                            check

Exception on not connected:

Error: XMLHttpRequest error.
    dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 942:28                get current
packages/http/src/browser_client.dart 81:22                                       <fn>