mirror of
https://github.com/leptos-rs/leptos.git
synced 2025-12-27 09:54:41 -05:00
chore: easing Display bound on FromServerFnError, #3811 follow-up
This commit is contained in:
@@ -201,14 +201,17 @@ pub mod browser {
|
||||
Ok(message) => Ok(Message::Bytes(message.into())),
|
||||
Err(err) => {
|
||||
let err = InputStreamError::de(err);
|
||||
let formatted_err = format!("{:?}", err);
|
||||
web_sys::console::error_1(
|
||||
&js_sys::JsString::from(err.to_string()),
|
||||
&js_sys::JsString::from(
|
||||
formatted_err.clone(),
|
||||
),
|
||||
);
|
||||
const CLOSE_CODE_ERROR: u16 = 1011;
|
||||
Err(WebSocketError::ConnectionClose(
|
||||
CloseEvent {
|
||||
code: CLOSE_CODE_ERROR,
|
||||
reason: err.to_string(),
|
||||
reason: formatted_err,
|
||||
was_clean: true,
|
||||
},
|
||||
))
|
||||
@@ -303,7 +306,7 @@ pub mod reqwest {
|
||||
Err(err) => {
|
||||
let err = E::de(err);
|
||||
Err(tokio_tungstenite::tungstenite::Error::Io(
|
||||
std::io::Error::other(err.to_string()),
|
||||
std::io::Error::other(format!("{:?}", err)),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -561,9 +561,7 @@ impl<E: FromServerFnError> FromStr for ServerFnErrorWrapper<E> {
|
||||
}
|
||||
|
||||
/// A trait for types that can be returned from a server function.
|
||||
pub trait FromServerFnError:
|
||||
std::fmt::Debug + Sized + Display + 'static
|
||||
{
|
||||
pub trait FromServerFnError: std::fmt::Debug + Sized + 'static {
|
||||
/// The encoding strategy used to serialize and deserialize this error type. Must implement the [`Encodes`](server_fn::Encodes) trait for references to the error type.
|
||||
type Encoder: Encodes<Self> + Decodes<Self>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user