/* * SPDX-FileCopyrightText: 2019-2021 Vishesh Handa * * SPDX-License-Identifier: AGPL-3.0-or-later */ import 'githost.dart'; class GitHostExceptionCatcher implements GitHost { final GitHost _; GitHostExceptionCatcher(GitHost host) : _ = host; @override void init(OAuthCallback oAuthCallback) => _.init(oAuthCallback); @override Future launchOAuthScreen() => _.launchOAuthScreen(); @override Future> getUserInfo() => catchAll(_.getUserInfo); @override Future>> listRepos() => catchAll(_.listRepos); @override Future> createRepo(String name) => catchAll(() => _.createRepo(name)); @override Future> getRepo(String name) => catchAll(() => _.getRepo(name)); @override Future> addDeployKey(String sshPublicKey, String repoFullName) => catchAll(() => _.addDeployKey(sshPublicKey, repoFullName)); }