9d1a37e248
Build and Push Docker Images / detect-changes (push) Successful in 10s
Build and Push Docker Images / build-auth-api (push) Successful in 58s
Build and Push Docker Images / build-employee-api (push) Successful in 58s
Build and Push Docker Images / build-transit-api (push) Successful in 59s
Build and Push Docker Images / build-error-log-api (push) Successful in 1m8s
Build and Push Docker Images / build-admin-ui (push) Successful in 1m14s
Build and Push Docker Images / deploy-test-node (push) Successful in 5s
27 lines
662 B
Dart
27 lines
662 B
Dart
import 'dart:convert';
|
|
import 'package:http/http.dart' as http;
|
|
|
|
class ErrorLogService {
|
|
static const String _apiBaseUrl = 'https://transit.xtransit.testinstance.nl';
|
|
|
|
static Future<void> report({
|
|
required String service,
|
|
required String partOfService,
|
|
required String error,
|
|
}) async {
|
|
try {
|
|
await http.post(
|
|
Uri.parse('$_apiBaseUrl/error_log'),
|
|
headers: {'Content-Type': 'application/json'},
|
|
body: jsonEncode({
|
|
'service': service,
|
|
'partOfService': partOfService,
|
|
'error': error,
|
|
}),
|
|
);
|
|
} catch (_) {
|
|
// Intentionally ignore logging failures.
|
|
}
|
|
}
|
|
}
|