Future<T> doOnError(void Function(Object error) action) async { try { return await this; } catch (e) { action(e); rethrow; } }