forked from parse-community/Parse-SDK-Flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparse_exception.dart
44 lines (33 loc) · 1.15 KB
/
parse_exception.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
part of '../../parse_server_sdk.dart';
abstract class ParseException implements Exception {}
class ParseRelationException implements ParseException {
final String? message;
const ParseRelationException([this.message]);
@override
String toString() {
if (message == null) return "ParseRelationException";
return "ParseRelationException: $message";
}
}
class ParseOperationException implements ParseException {
final String? message;
const ParseOperationException([this.message]);
@override
String toString() {
if (message == null) return "ParseOperationException";
return "ParseOperationException: $message";
}
}
class _UnmergeableOperationException extends ParseOperationException {
final _ParseOperation current;
final Object previous;
const _UnmergeableOperationException(this.current, this.previous);
@override
String toString() {
if (previous is _ParseOperation) {
return '${current.operationName} operation is invalid after '
'${(previous as _ParseOperation).operationName} operation';
}
return 'can not perform ${current.operationName} merge operation on the previous value $previous';
}
}