Skip to content

Commit

Permalink
Return correct format for SAB to print error
Browse files Browse the repository at this point in the history
  • Loading branch information
FyreByrd committed Dec 4, 2024
1 parent bc8105e commit b6c9b07
Showing 1 changed file with 6 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ export async function POST({ params, request, fetch }) {
if (!project) {
return new Response(
JSON.stringify({
errors: [
{
error: `Project id=${projectId} not found`
}
]
errors: [{ title: `Project id=${projectId} not found` }]
}),
{
status: 404
Expand All @@ -84,11 +80,7 @@ export async function POST({ params, request, fetch }) {
if (!project.WorkflowProjectUrl) {
return new Response(
JSON.stringify({
errors: [
{
error: `Project id=${projectId}: WorkflowProjectUrl is null`
}
]
errors: [{ title: `Project id=${projectId}: WorkflowProjectUrl is null` }]
}),
{
status: 404
Expand Down Expand Up @@ -137,7 +129,7 @@ export async function POST({ params, request, fetch }) {
JSON.stringify({
errors: [
{
error: `Project id=${projectId}, user='${user[0].Name}' with email='${user[0].Email}' does not have permission to access`
title: `Project id=${projectId}, user='${user[0].Name}' with email='${user[0].Email}' does not have permission to access`
}
]
}),
Expand All @@ -152,7 +144,7 @@ export async function POST({ params, request, fetch }) {
JSON.stringify({
errors: [
{
error: `Project id=${projectId}, user='${user[0].Name}' with email='${user[0].Email}' does not have permission to Upload`
title: `Project id=${projectId}, user='${user[0].Name}' with email='${user[0].Email}' does not have permission to Upload`
}
]
}),
Expand All @@ -174,11 +166,7 @@ export async function POST({ params, request, fetch }) {
if (!tokenResult || tokenResult.responseType === 'error') {
return new Response(
JSON.stringify({
errors: [
{
error: `Project id=${projectId}: GetProjectToken returned null`
}
]
errors: [{ title: `Project id=${projectId}: GetProjectToken returned null` }]
}),
{
status: 400
Expand All @@ -188,11 +176,7 @@ export async function POST({ params, request, fetch }) {
if (tokenResult.SecretAccessKey == null) {
return new Response(
JSON.stringify({
errors: [
{
error: `Project id=${projectId}: Token.SecretAccessKey is null`
}
]
errors: [{ title: `Project id=${projectId}: Token.SecretAccessKey is null` }]
}),
{
status: 400
Expand Down

0 comments on commit b6c9b07

Please sign in to comment.