-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
impact: customerA bug with low impact (e.g. affecting only a few customers or has a workaround). (P3)A bug with low impact (e.g. affecting only a few customers or has a workaround). (P3)plugin: functionstype: bugSomething isn't workingSomething isn't working
Description
Describe the bug
When calling .call trying to get an error (i.e. with wrong parameters, wrong function name or wrong region) I'm getting a PlatformException instead of a CloudFunctionsException
To Reproduce
This is the function that actually call .call
Future<num> _simpleFunction(String param1, String param2) async {
final HttpsCallable _simpleFunction =
CloudFunctions(region: "europe-west1")
.getHttpsCallable(functionName: 'simpleFunction');
try {
final HttpsCallableResult response = await _addUserRemainder
.call(<String, dynamic>{'param1': param1, 'param2': param2});
return response.data['result'];
} on CloudFunctionsException catch (e) {
print('catched $e');
rethrow;
}
}
And this is where I call _simpleFunction
try {
num balance;
balance =
await _simpleFunction('param', 'param2');
}
} catch (error) {
print('Main block $error');
}
And I always get:
I/flutter (10343): Main block PlatformException(functionsError, Cloud function failed with exception., {code: INVALID_ARGUMENT, details: null, message: Invalid QR code})
Expected behavior
Reading the implementation of .call function, it should always return a CloudFunctionsException instead.
Additional context
cloud_functions version is 0.4.2
Till the version 0.4.1+6 was working fine.
slosd, franvera, JensWalter, punkeroso, tantzygames and 14 more
Metadata
Metadata
Assignees
Labels
impact: customerA bug with low impact (e.g. affecting only a few customers or has a workaround). (P3)A bug with low impact (e.g. affecting only a few customers or has a workaround). (P3)plugin: functionstype: bugSomething isn't workingSomething isn't working