Skip to content

Commit 6fe4130

Browse files
committed
feat: add "null" handling for outbound and inbound network workload statuses in error messages
1 parent d74cac2 commit 6fe4130

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/lib/AppErrorTypeToMessage.svelte

+8-2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757
... on WorkloadStatusNoRunningInstances {
5858
level
5959
}
60+
... on WorkloadStatusOutboundNetwork {
61+
level
62+
}
63+
... on WorkloadStatusInboundNetwork {
64+
level
65+
}
6066
}
6167
`)
6268
)
@@ -107,7 +113,7 @@
107113
</Alert>
108114
{:else if type === 'WorkloadStatusInvalidNaisYaml'}
109115
<Alert variant={variant($data.level)}>
110-
The <em>nais.yaml</em> configuration is invalid for application <strong>{app}</strong>:
116+
The manifest for <strong>{app}</strong> includes invalid configuration:
111117
<br />{$data.detail}
112118
</Alert>
113119
{:else if type === 'WorkloadStatusSynchronizationFailing'}
@@ -207,7 +213,7 @@
207213
risk score of other severities exceeding 100. Please keep your dependencies up to date. See
208214
<a href="/team/{team}/{env}/app/{app}/image">image details</a> for more details.
209215
</Alert>
210-
{:else}
216+
{:else if type !== 'WorkloadStatusOutboundNetwork' && type !== 'WorkloadStatusInboundNetwork'}
211217
<Alert variant="error">Unkown error</Alert>
212218
{/if}
213219
</div>

src/lib/JobErrorTypeToMessage.svelte

+9-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
detail
4848
name
4949
}
50+
... on WorkloadStatusOutboundNetwork {
51+
level
52+
}
53+
... on WorkloadStatusInboundNetwork {
54+
level
55+
}
5056
}
5157
`)
5258
)
@@ -81,7 +87,8 @@
8187
</Alert>
8288
{:else if type === 'WorkloadStatusInvalidNaisYaml'}
8389
<Alert variant={variant($data.level)}>
84-
Nais-yaml might be invalid for application <strong>{job}</strong>.
90+
The manifest for <strong>{job}</strong> includes invalid configuration:
91+
<br />{$data.detail}
8592
</Alert>
8693
<!--{:else if type === 'WorkloadStatusInboundNetwork'}
8794
<Alert variant={variant($data.level)}>
@@ -171,7 +178,7 @@
171178
<h4>Failed to run job</h4>
172179
{$data.detail}
173180
</Alert>
174-
{:else}
181+
{:else if type !== 'WorkloadStatusOutboundNetwork' && type !== 'WorkloadStatusInboundNetwork'}
175182
<Alert variant="error">Unkown error</Alert>
176183
{/if}
177184
</div>

0 commit comments

Comments
 (0)