Skip to content

Commit

Permalink
fix: log in exceptionHandler, fix error dialog overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
arildm committed Jan 27, 2025
1 parent 328ee6e commit ff648ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/scripts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ import { getAllCorporaInFolders } from "./components/corpus-chooser/util"
korpApp.factory("$exceptionHandler", [
function () {
return (exception: Error) => {
// Also log it to make the stack trace available
console.error(exception)

// Cannot inject services normally here, because it creates circular dependencies
const $uibModal = getService("$uibModal")
const $rootScope = getService("$rootScope")
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/components/korp-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ angular.module("korpApp").component("korpError", {
template: html`
<div class="mx-auto flex flex-wrap items-center justify-center gap-8">
<img src="${korpFailImg}" alt="{{'fail_alt' | loc:$root.lang}}" />
<div class="max-w-screen-sm text-lg flex flex-col gap-2">
<div class="w-full max-w-screen-sm text-lg flex flex-col gap-2">
<div>{{'fail_text' | loc:$root.lang}}</div>
<pre ng-if="$ctrl.message" class="bg-zinc-100 p-2 px-4 text-base whitespace-pre-wrap">
<pre ng-if="$ctrl.message" class="bg-zinc-100 p-2 px-4 text-base whitespace-pre-wrap break-words">
{{$ctrl.message}}</pre
>
<div>{{'fail_contact' | loc:$root.lang}}</div>
Expand Down

0 comments on commit ff648ad

Please sign in to comment.