diff --git a/bindings/dart/lib/exception.dart b/bindings/dart/lib/exception.dart index cb522948..08d931f9 100644 --- a/bindings/dart/lib/exception.dart +++ b/bindings/dart/lib/exception.dart @@ -25,6 +25,7 @@ class OuisyncException implements Exception { ErrorCode.permissionDenied => PermissionDenied(message, sources), ErrorCode.serviceAlreadyRunning => ServiceAlreadyRunning(message, sources), + ErrorCode.unsupported => Unsupported(message, sources), ErrorCode.vfsDriverInstallError => VFSDriverInstallError(message, sources), _ => OuisyncException._(code, message, sources), @@ -34,9 +35,9 @@ class OuisyncException implements Exception { String toString() => [message].followedBy(sources).join(' → '); } -class PermissionDenied extends OuisyncException { - PermissionDenied([String? message, List sources = const []]) - : super._(ErrorCode.permissionDenied, message, sources); +class AlreadyExists extends OuisyncException { + AlreadyExists([String? message, List sources = const []]) + : super._(ErrorCode.alreadyExists, message, sources); } class InvalidData extends OuisyncException { @@ -44,21 +45,26 @@ class InvalidData extends OuisyncException { : super._(ErrorCode.invalidData, message, sources); } -class AlreadyExists extends OuisyncException { - AlreadyExists([String? message, List sources = const []]) - : super._(ErrorCode.alreadyExists, message, sources); -} - class NotFound extends OuisyncException { NotFound([String? message, List sources = const []]) : super._(ErrorCode.notFound, message, sources); } +class PermissionDenied extends OuisyncException { + PermissionDenied([String? message, List sources = const []]) + : super._(ErrorCode.permissionDenied, message, sources); +} + class ServiceAlreadyRunning extends OuisyncException { ServiceAlreadyRunning([String? message, List sources = const []]) : super._(ErrorCode.serviceAlreadyRunning, message, sources); } +class Unsupported extends OuisyncException { + Unsupported([String? message, List sources = const []]) + : super._(ErrorCode.unsupported, message, sources); +} + class VFSDriverInstallError extends OuisyncException { VFSDriverInstallError([String? message, List sources = const []]) : super._(ErrorCode.vfsDriverInstallError, message, sources); diff --git a/bindings/kotlin/lib/src/main/kotlin/org/equalitie/ouisync/lib/Error.kt b/bindings/kotlin/lib/src/main/kotlin/org/equalitie/ouisync/lib/Error.kt index f4deab74..1eb809b6 100644 --- a/bindings/kotlin/lib/src/main/kotlin/org/equalitie/ouisync/lib/Error.kt +++ b/bindings/kotlin/lib/src/main/kotlin/org/equalitie/ouisync/lib/Error.kt @@ -16,6 +16,7 @@ open class Error internal constructor( ErrorCode.NOT_FOUND -> NotFound(message, sources) ErrorCode.STORE_ERROR -> StoreError(message, sources) ErrorCode.SERVICE_ALREADY_RUNNING -> ServiceAlreadyRunning(message, sources) + ErrorCode.UNSUPPORTED -> Unsupported(message, sources) else -> Error(code, message, sources) } } @@ -36,4 +37,6 @@ open class Error internal constructor( class ServiceAlreadyRunning(message: String? = null, sources: List = emptyList()) : Error(ErrorCode.SERVICE_ALREADY_RUNNING, message, sources) + + class Unsupported(message: String? = null, sources: List = emptyList()) : Error(ErrorCode.UNSUPPORTED, message, sources) }