Skip to content

Commit 7a65ebe

Browse files
committedJan 24, 2025·
removed all server logs
1 parent 7dd7154 commit 7a65ebe

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed
 

‎src/app/lib/fetchNFTbyId.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export const getMetadataByMint = async (id :string) : Promise<{name: string, des
2424
return {name, description, imageuri};
2525
}
2626
catch (err) {
27-
if (err instanceof AxiosError) console.log(err.response?.data.errors);
28-
else console.error(err);
27+
if (err instanceof AxiosError) throw Error("Axios Error");
28+
else throw Error("Invalid")
2929
}
3030
}
3131

@@ -105,7 +105,7 @@ export async function getSlug(id: string): Promise<string|undefined>{
105105
return slug;
106106
}
107107
catch(err){
108-
if (err instanceof AxiosError) console.log(err.response?.data.errors);
109-
else console.error(err);
108+
if (err instanceof AxiosError) throw Error("Axios Error");
109+
else throw Error("Error occured while getting the slug");
110110
}
111111
}

‎src/app/lib/handleNFTDisplay.ts

+2-9
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export async function getRelatedNFTs(id: string){
3030
nfts = nfts.slice(0,nfts.length/3)
3131
return nfts;
3232
} catch(err){
33-
console.error(err)
3433
throw Error("No NFTs found of given collection!")
3534
}
3635

@@ -47,7 +46,6 @@ export async function getCollections(): Promise<Collection[]>{
4746
return collections;
4847
} catch(err){
4948
let default_collections = [{symbol : 'mad_lads'},{symbol : 'giga_buds'},{symbol : 'solana_monkey_business'},{symbol : 'mimany'},{symbol : 'rune_pkers'},{symbol : 'wifhoodies'},{symbol : 'claynosaurz'}];
50-
console.error(err);
5149
return default_collections;
5250
}
5351
}
@@ -77,7 +75,6 @@ export async function getNFTSFromCollections(collections: Collection[]): Promise
7775
listed: true
7876
};
7977
} catch (error) {
80-
console.error(error);
8178
return {
8279
id: id,
8380
slug: symbol,
@@ -116,7 +113,6 @@ export async function getListingsOfCollection(symbol: string): Promise<Listing[]
116113
return listings;
117114

118115
} catch(err){
119-
console.error(err);
120116
throw Error("unable to fetch listings of the given collection!")
121117
}
122118
}
@@ -132,9 +128,8 @@ export async function submitData(): Promise<void>{
132128
headers: { 'Content-Type': 'application/json' },
133129
body: JSON.stringify(body),
134130
});
135-
console.log("POST SUCCESS")
136131
} catch (error) {
137-
console.error(error);
132+
throw Error("Unable to submit data")
138133
}
139134
}
140135
}
@@ -146,10 +141,8 @@ export async function submitData(): Promise<void>{
146141
headers: { 'Content-Type': 'application/json' }
147142
});
148143
const list = (await res.json())
149-
console.log("list is here")
150144
return list;
151145
} catch (error) {
152-
console.error(error);
153146
throw Error("Unable to fetch list from /api/fetchlist")
154147
}
155148
}
@@ -163,6 +156,6 @@ export async function submitData(): Promise<void>{
163156
const count = (await res.json())
164157
return count;
165158
} catch (error) {
166-
console.error(error);
159+
throw Error("Unable to get Count")
167160
}
168161
}

‎src/app/lib/rate.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ export const getFloorPrice = async (slug: string): Promise<number|undefined> =>
3131
});
3232
const resp = await response.json();
3333
const priceOfListingInSol = resp[0].price;
34-
console.log("Current Listing Price Of NFT In SOL: ",priceOfListingInSol)
3534
return priceOfListingInSol;
3635
}
3736
catch(err){
38-
console.error(err)
3937
throw Error("Invalid Response")
4038
}
4139
}
@@ -48,7 +46,7 @@ export const getFloorPrice = async (slug: string): Promise<number|undefined> =>
4846
return price;
4947
}
5048
catch(err){
51-
console.log(err)
49+
throw Error("Invalid Price")
5250
}
5351
}
5452

@@ -60,6 +58,6 @@ export const getFloorPrice = async (slug: string): Promise<number|undefined> =>
6058
return price;
6159
}
6260
catch(err){
63-
console.log(err)
61+
throw Error("Invalid Price")
6462
}
6563
}

0 commit comments

Comments
 (0)
Please sign in to comment.