Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into meta-views
Browse files Browse the repository at this point in the history
  • Loading branch information
eceltov committed Dec 13, 2024
2 parents a1adcc6 + 10c08ec commit 106c6ea
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 24 deletions.
13 changes: 13 additions & 0 deletions app/model/entity/AsyncJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,21 @@ public function getError(): ?string
return $this->error;
}

/**
* Makes sure the error string fits the data column.
* Truncates and adds ellipsis '...' at the end if it overflows.
*/
private function sanitizeErrorLength(): void
{
if ($this->error !== null && strlen($this->error) > 250) {
$this->error = substr($this->error, 0, 250) . '...';
}
}

public function setError(?string $error)
{
$this->error = $error;
$this->sanitizeErrorLength();
}

public function appendError(string $error)
Expand All @@ -223,6 +235,7 @@ public function appendError(string $error)
} else {
$this->error .= "\n$error";
}
$this->sanitizeErrorLength();
}

/**
Expand Down
49 changes: 25 additions & 24 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 106c6ea

Please sign in to comment.