Skip to content

Commit

Permalink
chore: error responses should print informative errors by default (#88)
Browse files Browse the repository at this point in the history
* chore: error responses should print informative errors by default

* give more time buffer for flaky pubsub test
  • Loading branch information
anitarua committed Jan 9, 2024
1 parent 6fc4329 commit b04ba43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion lib/src/messages/responses/responses_base.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import '../../errors/errors.dart';

class ErrorResponseBase extends AbstractExceptionResponseBase {
class ErrorResponseBase extends AbstractExceptionResponseBase
implements Exception {
ErrorResponseBase(SdkException exception)
: super(exception.message, exception.errorCode, exception.innerException);

@override
String toString() {
return "[${super.errorCode}] ${super.message}";
}
}
4 changes: 2 additions & 2 deletions test/src/cache/topics_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void main() {
'Expected Success but got Error: ${subscribeResp.errorCode} ${subscribeResp.message}');
}

sleep(Duration(seconds: 1));
sleep(Duration(seconds: 5));
final publishResp = await topicClient.publish(
integrationTestCacheName, topicName, StringValue(topicValue));
switch (publishResp) {
Expand All @@ -90,7 +90,7 @@ void main() {
fail(
'Expected Success but got Error: ${publishResp.errorCode} ${publishResp.message}');
}
sleep(Duration(seconds: 1));
sleep(Duration(seconds: 5));

try {
await for (final msg in subscribeResp.stream) {
Expand Down

0 comments on commit b04ba43

Please sign in to comment.