-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from C0ntrolDev/dev-1.1
Ver 1.1.1
- Loading branch information
Showing
66 changed files
with
1,049 additions
and
678 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,43 @@ | ||
import 'package:spotify_downloader/core/utils/failures/failure.dart'; | ||
|
||
final class NotFoundFailure extends Failure { | ||
const NotFoundFailure({super.message = 'not found failure'}); | ||
abstract class NoDetailedFailure extends Failure { | ||
const NoDetailedFailure({required super.message, super.stackTrace}); | ||
|
||
@override | ||
String toString() { | ||
final type = runtimeType; | ||
return '$type: $message'; | ||
} | ||
} | ||
|
||
final class NetworkFailure extends Failure { | ||
const NetworkFailure({super.message = 'network failure'}); | ||
final class NotFoundFailure extends NoDetailedFailure { | ||
const NotFoundFailure({super.message = 'not found failure', super.stackTrace}); | ||
} | ||
|
||
final class ConverterFailure extends Failure { | ||
const ConverterFailure({super.message = 'converter failure'}); | ||
final class NetworkFailure extends NoDetailedFailure { | ||
const NetworkFailure({super.message = 'network failure', super.stackTrace}); | ||
} | ||
|
||
final class AuthFailure extends Failure { | ||
AuthFailure({super.message = 'auth failure'}); | ||
final class ConverterFailure extends NoDetailedFailure { | ||
const ConverterFailure({super.message = 'converter failure', super.stackTrace}); | ||
} | ||
|
||
final class InvalidClientCredentialsFailure extends Failure { | ||
InvalidClientCredentialsFailure({super.message = 'invalid auth credentials failure'}); | ||
final class AuthFailure extends NoDetailedFailure { | ||
AuthFailure({super.message = 'auth failure', super.stackTrace}); | ||
} | ||
|
||
final class InvalidAccountCredentialsFailure extends Failure { | ||
InvalidAccountCredentialsFailure({super.message = 'invalid refresh token failure'}); | ||
final class InvalidClientCredentialsFailure extends NoDetailedFailure { | ||
InvalidClientCredentialsFailure({super.message = 'invalid auth credentials failure', super.stackTrace}); | ||
} | ||
|
||
final class NotAuthorizedFailure extends Failure { | ||
NotAuthorizedFailure({super.message = 'User not authorized'}); | ||
final class InvalidAccountCredentialsFailure extends NoDetailedFailure { | ||
InvalidAccountCredentialsFailure({super.message = 'invalid refresh token failure', super.stackTrace}); | ||
} | ||
|
||
final class ForbiddenFailure extends Failure { | ||
ForbiddenFailure({super.message = 'Access Forbidden'}); | ||
} | ||
final class NotAuthorizedFailure extends NoDetailedFailure { | ||
NotAuthorizedFailure({super.message = 'User not authorized', super.stackTrace}); | ||
} | ||
|
||
final class ForbiddenFailure extends NoDetailedFailure { | ||
ForbiddenFailure({super.message = 'Access Forbidden', super.stackTrace}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
class Failure { | ||
const Failure({required this.message}); | ||
const Failure({required this.message, this.stackTrace}); | ||
|
||
final Object? stackTrace; | ||
final Object message; | ||
|
||
@override | ||
String toString() { | ||
return toDetailedString(); | ||
} | ||
|
||
String toDetailedString() { | ||
final type = runtimeType; | ||
return '$type: $message'; | ||
return '$type: "$stackTrace" $message'; | ||
} | ||
} |
Oops, something went wrong.