Loading...
Searching...
No Matches
alphabet/exception.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <concepts>
#include <stdexcept>
#include <string>
#include <seqan3/utility/char_operations/pretty_print.hpp>
namespace seqan3
{
struct invalid_char_assignment : std::runtime_error
{
invalid_char_assignment(std::string const & type_name, std::string const & wrong_char) :
std::runtime_error{std::string{"Assigning "} + wrong_char + " to an alphabet of type " + type_name
+ " would incur information loss. If you want implicit conversion, use "
"seqan3::assign_char instead of seqan3::assign_char_strict."}
{}
invalid_char_assignment(std::string const & type_name, char const wrong_char) :
invalid_char_assignment{type_name, detail::make_printable(wrong_char)}
{}
template <std::convertible_to<char> char_t>
invalid_char_assignment(std::string const & type_name, char_t const wrong_char) :
invalid_char_assignment{type_name, static_cast<char>(wrong_char)}
{}
};
} // namespace seqan3
std::string
seqan3
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
std
SeqAn specific customisations in the standard namespace.
pretty_print.hpp
Provides seqan3::detail::make_printable which converts non printable characters (e....
std::runtime_error
stdexcept
string
seqan3::invalid_char_assignment::invalid_char_assignment
invalid_char_assignment(std::string const &type_name, char const wrong_char)
Definition alphabet/exception.hpp:42
seqan3::invalid_char_assignment::invalid_char_assignment
invalid_char_assignment(std::string const &type_name, char_t const wrong_char)
Definition alphabet/exception.hpp:51
seqan3::invalid_char_assignment::invalid_char_assignment
invalid_char_assignment(std::string const &type_name, std::string const &wrong_char)
Constructor that takes the type name and the failed character as arguments.
Definition alphabet/exception.hpp:32
Hide me