unproductive flailing

This commit is contained in:
Joseph Montanaro
2022-12-28 15:48:25 -08:00
parent 992e3c8db2
commit cb26201506
5 changed files with 31 additions and 6 deletions

View File

@ -77,4 +77,4 @@ fn default_listen_addr() -> Ipv4Addr { Ipv4Addr::LOCALHOST }
fn default_rehide_ms() -> u64 { 1000 }
fn default_start_minimized() -> bool { true }
fn default_start_minimized() -> bool { !cfg!(debug_assertions) } // default to start-minimized in production only

View File

@ -10,13 +10,15 @@ use sqlx::{
};
use serde::{Serialize, Serializer, ser::SerializeMap};
use strum_macros::IntoStaticStr;
pub struct SerializeError<E> {
pub err: E
}
impl<E: std::error::Error> Serialize for SerializeError<E> {
impl<E: std::error::Error> Serialize for SerializeError<E>
{
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut map = serializer.serialize_map(None)?;
map.serialize_entry("msg", &format!("{}", self.err))?;
@ -50,7 +52,7 @@ pub enum SetupError {
// error when attempting to tell a request handler whether to release or deny credentials
#[derive(Debug, ThisError)]
#[derive(Debug, ThisError, IntoStaticStr)]
pub enum SendResponseError {
#[error("The specified credentials request was not found")]
NotFound, // no request with the given id