aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ba/back/src/error
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-06 22:08:26 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-06 22:08:26 +0200
commit21b9a461dafeab63893d82a82d7b84ffe3a59c40 (patch)
treedfb8e657e2f36b426d9fba1b1a703431836d92e5 /pkgs/by-name/ba/back/src/error
parentflake.nix: Use the packaged version of `ragenix` (diff)
downloadnixos-server-21b9a461dafeab63893d82a82d7b84ffe3a59c40.zip
pkgs/back: Remove
Back has been moved out-of-tree.
Diffstat (limited to '')
-rw-r--r--pkgs/by-name/ba/back/src/error/mod.rs134
1 files changed, 0 insertions, 134 deletions
diff --git a/pkgs/by-name/ba/back/src/error/mod.rs b/pkgs/by-name/ba/back/src/error/mod.rs
deleted file mode 100644
index 8889033..0000000
--- a/pkgs/by-name/ba/back/src/error/mod.rs
+++ /dev/null
@@ -1,134 +0,0 @@
-// Back - An extremely simple git issue tracking system. Inspired by tvix's
-// panettone
-//
-// Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-// SPDX-License-Identifier: AGPL-3.0-or-later
-//
-// This file is part of Back.
-//
-// You should have received a copy of the License along with this program.
-// If not, see <https://www.gnu.org/licenses/agpl.txt>.
-
-use std::{fmt::Display, io, net::SocketAddr, path::PathBuf};
-
-use gix::hash::Prefix;
-use thiserror::Error;
-
-pub type Result<T> = std::result::Result<T, Error>;
-
-#[derive(Error, Debug)]
-pub enum Error {
- ConfigParse {
- file: PathBuf,
- error: serde_json::Error,
- },
-
- ProjectListRead {
- file: PathBuf,
- error: io::Error,
- },
- ConfigRead {
- file: PathBuf,
- error: io::Error,
- },
- NotGitBug {
- path: PathBuf,
- },
- RepoOpen {
- repository_path: PathBuf,
- error: Box<gix::open::Error>,
- },
- RepoFind {
- repository_path: PathBuf,
- },
- RepoRefsIter(#[from] gix::refs::packed::buffer::open::Error),
- RepoRefsPrefixed {
- error: io::Error,
- },
-
- TcpBind {
- addr: SocketAddr,
- err: io::Error,
- },
- TcpAccept {
- err: io::Error,
- },
-
- IssuesPrefixMissing {
- prefix: Prefix,
- },
- IssuesPrefixParse(#[from] gix::hash::prefix::from_hex::Error),
-}
-
-impl Display for Error {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- match self {
- Error::ConfigParse { file, error } => {
- write!(
- f,
- "while trying to parse the config file ({}): {error}",
- file.display()
- )
- }
- Error::ProjectListRead { file, error } => {
- write!(
- f,
- "while trying to read the project.list file ({}): {error}",
- file.display()
- )
- }
- Error::ConfigRead { file, error } => {
- write!(
- f,
- "while trying to read the config file ({}): {error}",
- file.display()
- )
- }
- Error::RepoOpen {
- repository_path,
- error,
- } => {
- write!(
- f,
- "while trying to open the repository ({}): {error}",
- repository_path.display()
- )
- }
- Error::NotGitBug { path } => {
- write!(
- f,
- "Repository ('{}') has no initialized git-bug data",
- path.display()
- )
- }
- Error::RepoFind { repository_path } => {
- write!(
- f,
- "failed to find the repository at path: '{}'",
- repository_path.display()
- )
- }
- Error::RepoRefsIter(error) => {
- write!(f, "while iteration over the refs in a repository: {error}",)
- }
- Error::RepoRefsPrefixed { error, .. } => {
- write!(f, "while prefixing the refs with a path: {error}")
- }
- Error::IssuesPrefixMissing { prefix } => {
- write!(
- f,
- "There is no 'issue' associated with the prefix: {prefix}"
- )
- }
- Error::IssuesPrefixParse(error) => {
- write!(f, "The given prefix can not be parsed as prefix: {error}")
- }
- Error::TcpBind { addr, err } => {
- write!(f, "while trying to open tcp {addr} for listening: {err}.")
- }
- Error::TcpAccept { err } => {
- write!(f, "while trying to accept a tcp connection: {err}.")
- }
- }
- }
-}