chore: remove logging on expected errors

This commit is contained in:
Aarnav Tale 2024-11-08 12:04:24 -05:00
parent c304effcdf
commit feb8b8bba5
No known key found for this signature in database

View File

@ -20,9 +20,6 @@ export class FatalError extends Error {
export async function pull<T>(url: string, key: string) {
if (!key || key === 'undefined' || key.length === 0) {
log.error('APIC', 'Missing API key, could this be a cookie setting issue?')
log.error('APIC', 'Check that the hp_sess cookie is being set correctly')
log.error('APIC', 'If you are running without HTTPs, make sure the Secure flag is false')
throw new Error('Missing API key, could this be a cookie setting issue?')
}
@ -46,9 +43,6 @@ export async function pull<T>(url: string, key: string) {
export async function post<T>(url: string, key: string, body?: unknown) {
if (!key || key === 'undefined' || key.length === 0) {
log.error('APIC', 'Missing API key, could this be a cookie setting issue?')
log.error('APIC', 'Check that the hp_sess cookie is being set correctly')
log.error('APIC', 'If you are running without HTTPs, make sure the Secure flag is false')
throw new Error('Missing API key, could this be a cookie setting issue?')
}
@ -74,9 +68,6 @@ export async function post<T>(url: string, key: string, body?: unknown) {
export async function put<T>(url: string, key: string, body?: unknown) {
if (!key || key === 'undefined' || key.length === 0) {
log.error('APIC', 'Missing API key, could this be a cookie setting issue?')
log.error('APIC', 'Check that the hp_sess cookie is being set correctly')
log.error('APIC', 'If you are running without HTTPs, make sure the Secure flag is false')
throw new Error('Missing API key, could this be a cookie setting issue?')
}
@ -102,9 +93,6 @@ export async function put<T>(url: string, key: string, body?: unknown) {
export async function del<T>(url: string, key: string) {
if (!key || key === 'undefined' || key.length === 0) {
log.error('APIC', 'Missing API key, could this be a cookie setting issue?')
log.error('APIC', 'Check that the hp_sess cookie is being set correctly')
log.error('APIC', 'If you are running without HTTPs, make sure the Secure flag is false')
throw new Error('Missing API key, could this be a cookie setting issue?')
}