healthCheck throws error #799
Labels
bounty:$20
Bounty applies for fixing this issue (Parse Bounty Program)
type:bug
Impaired feature or lacking behavior that is likely assumed
Uh oh!
There was an error while loading. Please reload this page.
I'm building a tutorial for Parse Serve (using Back4app) and ran into this issue on SKD for Flutter.
New Issue Checklist
Issue Description
I tested the following code:
Steps to reproduce
Create a pure standard Dart project with VSCode
Create a basic project in back4app and write down the appId and clientKey.
Copy the code above to your Dart project and enter the correct appId and clientKey and then a wrong value.
Run the Dart project with:
$ dart bin/learning_about_b4a_dart.dart
Actual Outcome
If I put the correct appId and clientKey values I get:
Parse().hasParseBeenInitialized(): true
response.success: true
Bach4App: Ok
But if I put the wrong appId and clientKey values I get:
Parse().hasParseBeenInitialized(): true
Unhandled exception:
type 'Null' is not a subtype of type 'int'
#0 buildErrorResponse (package:parse_server_sdk/src/objects/response/parse_error_response.dart:8:25)
#1 _ParseResponseBuilder.handleResponse (package:parse_server_sdk/src/objects/response/parse_response_builder.dart:18:14)
#2 handleResponse (package:parse_server_sdk/src/objects/response/parse_response_utils.dart:8:31)
#3 Parse.healthCheck (package:parse_server_sdk/parse_server_sdk.dart:158:14)
#4 main (file:///home/catalunha/myapp/learning_about_b4a_dart/bin/learning_about_b4a_dart.dart:20:20)
There was an error when calling: await parse.healthCheck();
Expected Outcome
The return from await parse.healthCheck() is a Future so I would expect a parseResponse.success = false as I entered incorrect appId and clientKey values. But actually I get an error in the SDK.
🇧🇷
Because in my tutorial the user can change the appId and clientKey to test my tutorial.
So if it reports a wrong appId and clientKey I have an SDK error and not a parseResponse.success=false return.
Environment
Parse Flutter SDK
Server
4.5.0
Logs
The text was updated successfully, but these errors were encountered: