step 17 : proteksi presensi selfie button clock in & clock out
This commit is contained in:
@@ -18,7 +18,16 @@ abstract class BaseRepository {
|
||||
final QueryResult result = await graphql.mutate(options);
|
||||
|
||||
if (result.hasException) {
|
||||
throw BaseRepositoryException(message: result.exception.toString());
|
||||
// throw BaseRepositoryException(message: result.exception.toString());
|
||||
if (result.exception != null) {
|
||||
if (result.exception!.graphqlErrors.isNotEmpty) {
|
||||
String error = "";
|
||||
if (result.exception!.graphqlErrors[0].message != "") {
|
||||
error += result.exception!.graphqlErrors[0].message;
|
||||
throw BaseRepositoryException(message: error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return result.data!;
|
||||
@@ -36,9 +45,20 @@ abstract class BaseRepository {
|
||||
final QueryResult result = await graphql.query(options);
|
||||
|
||||
if (result.hasException) {
|
||||
throw BaseRepositoryException(message: result.exception.toString());
|
||||
// throw BaseRepositoryException(message: result.exception.toString());
|
||||
if (result.exception != null) {
|
||||
if (result.exception!.graphqlErrors.isNotEmpty) {
|
||||
if (result.exception!.graphqlErrors[0].message != "") {
|
||||
throw BaseRepositoryException(
|
||||
message: result.exception!.graphqlErrors[0].message.toString(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// throw BaseRepositoryException(message: result.exception.toString());
|
||||
|
||||
return result.data!;
|
||||
} catch (e) {
|
||||
throw BaseRepositoryException(message: e.toString());
|
||||
|
||||
Reference in New Issue
Block a user