mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-12-18 22:21:32 +08:00
Don't show output init timeout message on serialization error (#1096)
This commit is contained in:
parent
d567adaa17
commit
8b17365bf9
2 changed files with 8 additions and 4 deletions
|
|
@ -95,8 +95,8 @@ const JSView = {
|
|||
|
||||
const errorRef = this.channel.on(
|
||||
`error:${this.props.ref}`,
|
||||
({ message }) => {
|
||||
this.handleServerError(message);
|
||||
({ message, init }) => {
|
||||
this.handleServerError(message, init);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -334,7 +334,11 @@ const JSView = {
|
|||
});
|
||||
},
|
||||
|
||||
handleServerError(message) {
|
||||
handleServerError(message, init) {
|
||||
if (init) {
|
||||
this.clearInitTimeout();
|
||||
}
|
||||
|
||||
if (!this.errorContainer) {
|
||||
this.errorContainer = document.createElement("div");
|
||||
this.errorContainer.classList.add("error-box", "mb-4");
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ defmodule LivebookWeb.JSViewChannel do
|
|||
|
||||
with {:error, error} <- try_push(socket, "init:#{ref}:#{id}", nil, payload) do
|
||||
message = "Failed to serialize initial widget data, " <> error
|
||||
push(socket, "error:#{ref}", %{"message" => message})
|
||||
push(socket, "error:#{ref}", %{"message" => message, "init" => true})
|
||||
end
|
||||
|
||||
{:noreply, socket}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue