refacto: error and types

This commit is contained in:
Julien Froidefond
2025-02-27 21:59:14 +01:00
parent ea51ff53a9
commit 279f6c6e88
37 changed files with 800 additions and 684 deletions

View File

@@ -20,6 +20,7 @@ export async function GET(
{
error: {
code: error.code,
name: "Image fetch error",
message: getErrorMessage(error.code),
},
},
@@ -30,6 +31,7 @@ export async function GET(
{
error: {
code: ERROR_CODES.IMAGE.FETCH_ERROR,
name: "Image fetch error",
message: getErrorMessage(ERROR_CODES.IMAGE.FETCH_ERROR),
},
},

View File

@@ -18,6 +18,7 @@ export async function GET(
{
error: {
code: ERROR_CODES.BOOK.PAGES_FETCH_ERROR,
name: "Image fetch error",
message: getErrorMessage(ERROR_CODES.BOOK.PAGES_FETCH_ERROR),
},
},
@@ -34,6 +35,7 @@ export async function GET(
{
error: {
code: error.code,
name: "Image fetch error",
message: getErrorMessage(error.code),
},
},
@@ -44,6 +46,7 @@ export async function GET(
{
error: {
code: ERROR_CODES.IMAGE.FETCH_ERROR,
name: "Image fetch error",
message: getErrorMessage(ERROR_CODES.IMAGE.FETCH_ERROR),
},
},

View File

@@ -15,6 +15,7 @@ export async function GET(request: NextRequest, { params }: { params: { bookId:
{
error: {
code: error.code,
name: "Image fetch error",
message: getErrorMessage(error.code),
},
},
@@ -25,6 +26,7 @@ export async function GET(request: NextRequest, { params }: { params: { bookId:
{
error: {
code: ERROR_CODES.IMAGE.FETCH_ERROR,
name: "Image fetch error",
message: getErrorMessage(ERROR_CODES.IMAGE.FETCH_ERROR),
},
},

View File

@@ -17,6 +17,7 @@ export async function GET(request: NextRequest, { params }: { params: { seriesId
{
error: {
code: error.code,
name: "Image fetch error",
message: getErrorMessage(error.code),
},
},
@@ -27,6 +28,7 @@ export async function GET(request: NextRequest, { params }: { params: { seriesId
{
error: {
code: ERROR_CODES.IMAGE.FETCH_ERROR,
name: "Image fetch error",
message: getErrorMessage(ERROR_CODES.IMAGE.FETCH_ERROR),
},
},

View File

@@ -15,6 +15,7 @@ export async function GET(request: NextRequest, { params }: { params: { seriesId
{
error: {
code: error.code,
name: "Image fetch error",
message: getErrorMessage(error.code),
},
},
@@ -25,6 +26,7 @@ export async function GET(request: NextRequest, { params }: { params: { seriesId
{
error: {
code: ERROR_CODES.IMAGE.FETCH_ERROR,
name: "Image fetch error",
message: getErrorMessage(ERROR_CODES.IMAGE.FETCH_ERROR),
},
},