Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/functions/synchronous.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Buffer } from 'buffer'
import { inspect } from 'util'

import { renderFunctionErrorPage } from '@netlify/dev-utils'
import express from 'express'
import { isReadableStream as baseIsReadableStream } from 'is-stream'
import type { LambdaEvent } from 'lambda-local'

import { chalk, logPadded, NETLIFYDEVERR } from '../../utils/command-helpers.js'
import renderErrorTemplate from '../render-error-template.js'

import { warnIfAwsSdkError } from './utils.js'
import type { InvocationError } from './netlify-function.js'
Expand Down Expand Up @@ -161,7 +161,7 @@ const handleErr = async (

if (acceptsHtml) {
response.setHeader('Content-Type', 'text/html')
response.end(await renderErrorTemplate(errorString, '../../src/lib/templates/function-error.html', 'function'))
response.end(await renderFunctionErrorPage(errorString, 'function'))
} else {
response.end(errorString)
}
Expand Down
24 changes: 0 additions & 24 deletions src/lib/render-error-template.ts

This file was deleted.

303 changes: 0 additions & 303 deletions src/lib/templates/function-error.html

This file was deleted.

4 changes: 2 additions & 2 deletions src/utils/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import url from 'url'
import util from 'util'
import zlib from 'zlib'

import { renderFunctionErrorPage } from '@netlify/dev-utils'
import contentType from 'content-type'
import cookie from 'cookie'
import { getProperty } from 'dot-prop'
Expand All @@ -37,7 +38,6 @@ import { fileExistsAsync, isFileAsync } from '../lib/fs.js'
import { getFormHandler } from '../lib/functions/form-submissions-handler.js'
import { DEFAULT_FUNCTION_URL_EXPRESSION } from '../lib/functions/registry.js'
import { initializeProxy as initializeImageProxy, isImageRequest } from '../lib/images/proxy.js'
import renderErrorTemplate from '../lib/render-error-template.js'

import { NETLIFYDEVLOG, NETLIFYDEVWARN, type NormalizedCachedConfigConfig, chalk, log } from './command-helpers.js'
import createStreamPromise from './create-stream-promise.js'
Expand Down Expand Up @@ -731,7 +731,7 @@ const initializeProxy = async function ({
const decompressedBody = await decompressResponseBody(responseBody, proxyRes.headers['content-encoding'])
const formattedBody = formatEdgeFunctionError(decompressedBody, acceptsHtml)
const errorResponse = acceptsHtml
? await renderErrorTemplate(formattedBody, '../../src/lib/templates/function-error.html', 'edge function')
? await renderFunctionErrorPage(formattedBody, 'edge function')
: formattedBody
const contentLength = Buffer.from(errorResponse, 'utf8').byteLength

Expand Down
Loading