etape3
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/// Erreurs métier pour les appels API 42.
|
||||
sealed class IntraApiException implements Exception {
|
||||
const IntraApiException(this.message);
|
||||
final String message;
|
||||
|
||||
@override
|
||||
String toString() => message;
|
||||
}
|
||||
|
||||
class IntraNotAuthenticatedException extends IntraApiException {
|
||||
const IntraNotAuthenticatedException()
|
||||
: super('Connecte-toi d’abord à l’API 42');
|
||||
}
|
||||
|
||||
class IntraUserNotFoundException extends IntraApiException {
|
||||
const IntraUserNotFoundException()
|
||||
: super('Aucun utilisateur pour ce login');
|
||||
}
|
||||
|
||||
class IntraNetworkException extends IntraApiException {
|
||||
const IntraNetworkException()
|
||||
: super('Connexion impossible. Vérifie le réseau.');
|
||||
}
|
||||
|
||||
class IntraUnauthorizedException extends IntraApiException {
|
||||
const IntraUnauthorizedException()
|
||||
: super('Session expirée. Reconnecte-toi à l’API 42');
|
||||
}
|
||||
|
||||
class IntraApiErrorException extends IntraApiException {
|
||||
const IntraApiErrorException(super.message);
|
||||
}
|
||||
Reference in New Issue
Block a user