mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-24 14:47:13 -04:00
fix flutter analyze issue
This commit is contained in:
parent
685643be36
commit
5d94c63377
1 changed files with 34 additions and 1 deletions
|
@ -1,8 +1,41 @@
|
|||
import 'package:flowy_logger/flowy_logger.dart';
|
||||
import 'package:flowy_sdk/dispatch/flowy_error.dart';
|
||||
import 'package:flowy_sdk/protobuf/ffi_request.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/ffi_response.pb.dart';
|
||||
|
||||
class FlowyError {
|
||||
late FFIStatusCode _statusCode;
|
||||
late String _error;
|
||||
|
||||
FFIStatusCode get statusCode {
|
||||
return _statusCode;
|
||||
}
|
||||
|
||||
String get error {
|
||||
return _error;
|
||||
}
|
||||
|
||||
bool get has_error {
|
||||
return _statusCode != FFIStatusCode.Ok;
|
||||
}
|
||||
|
||||
String toString() {
|
||||
return "$_statusCode: $_error";
|
||||
}
|
||||
|
||||
FlowyError({required FFIStatusCode statusCode, required String error}) {
|
||||
_statusCode = statusCode;
|
||||
_error = error;
|
||||
}
|
||||
|
||||
factory FlowyError.from(FFIResponse resp) {
|
||||
return FlowyError(statusCode: resp.code, error: resp.error);
|
||||
}
|
||||
|
||||
factory FlowyError.fromError(String error) {
|
||||
return FlowyError(statusCode: FFIStatusCode.Err, error: error);
|
||||
}
|
||||
}
|
||||
|
||||
class StackTraceError {
|
||||
Object error;
|
||||
StackTrace trace;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue