better error message and loading view
This commit is contained in:
@ -2,7 +2,11 @@ import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:openmediacentermobile/api/token.dart';
|
||||
import 'token.dart';
|
||||
|
||||
class TokenException implements Exception {
|
||||
String wdExpMsg() => 'Invalid token in storage!';
|
||||
}
|
||||
|
||||
class API {
|
||||
static Future<String> query(
|
||||
@ -20,7 +24,7 @@ class API {
|
||||
|
||||
return resp.body;
|
||||
} else {
|
||||
return "";
|
||||
throw TokenException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user