2
0

🚸 (nocodb) Clean up error messages

Closes #1568
This commit is contained in:
Baptiste Arnaud
2024-06-14 10:05:16 +02:00
parent ff16706d7d
commit 0f2f4d2130
4 changed files with 15 additions and 3 deletions

View File

@ -3,6 +3,7 @@ import { auth } from '../auth'
import ky, { HTTPError } from 'ky'
import { defaultBaseUrl } from '../constants'
import { parseRecordsCreateBody } from '../helpers/parseRecordCreateBody'
import { parseErrorResponse } from '../helpers/parseErrorResponse'
export const createRecord = createAction({
auth,
@ -52,7 +53,7 @@ export const createRecord = createAction({
return logs.add({
status: 'error',
description: error.message,
details: await error.response.text(),
details: await parseErrorResponse(error.response),
})
console.error(error)
}

View File

@ -10,6 +10,7 @@ import {
defaultLimitForSearch,
filterOperators,
} from '../constants'
import { parseErrorResponse } from '../helpers/parseErrorResponse'
export const searchRecords = createAction({
auth,
@ -127,7 +128,7 @@ export const searchRecords = createAction({
return logs.add({
status: 'error',
description: error.message,
details: await error.response.text(),
details: await parseErrorResponse(error.response),
})
console.error(error)
}

View File

@ -10,6 +10,7 @@ import {
import { parseSearchParams } from '../helpers/parseSearchParams'
import { convertFilterToWhereClause } from '../helpers/convertFilterToWhereClause'
import { ListTableRecordsResponse } from '../types'
import { parseErrorResponse } from '../helpers/parseErrorResponse'
export const updateExistingRecord = createAction({
auth,
@ -94,7 +95,7 @@ export const updateExistingRecord = createAction({
return logs.add({
status: 'error',
description: error.message,
details: await error.response.text(),
details: await parseErrorResponse(error.response),
})
console.error(error)
}