@@ -13,111 +13,117 @@ export async function generateMetadata({
13
13
} : {
14
14
params : { id : string } ;
15
15
} ) : Promise < Metadata > {
16
- const paper : PaperResponse | null = await fetchPaperID ( params . id ) ;
16
+ try {
17
+ const paper : PaperResponse | null = await fetchPaperID ( params . id ) ;
17
18
18
- if ( paper ) {
19
- return {
20
- metadataBase : new URL ( "https://papers.codechefvit.com/" ) ,
21
- title : `Papers | ${ paper . subject } | ${ paper . exam } | ${ paper . slot } ` ,
22
- description : `Discover ${ paper . subject } 's question paper created by CodeChef-VIT at Vellore Institute of Technology. Made with ♡ to help students excel.` ,
23
- icons : [ { rel : "icon" , url : "/codechef_logo.svg" } ] ,
24
- openGraph : {
25
- title : `Papers | ${ paper . subject } | ${ paper . exam } | ${ paper . slot } ` ,
26
- images : [ { url : "/papers.png" } ] ,
27
- url : "https://papers.codechefvit.com/" ,
28
- type : "website" ,
29
- description : `Discover ${ paper . subject } 's question paper created by CodeChef-VIT at Vellore Institute of Technology. Made with ♡ to help students excel.` ,
30
- siteName : "Papers by CodeChef-VIT" ,
31
- } ,
32
- twitter : {
33
- card : "summary_large_image" ,
19
+ if ( paper ) {
20
+ return {
21
+ metadataBase : new URL ( "https://papers.codechefvit.com/" ) ,
34
22
title : `Papers | ${ paper . subject } | ${ paper . exam } | ${ paper . slot } ` ,
35
23
description : `Discover ${ paper . subject } 's question paper created by CodeChef-VIT at Vellore Institute of Technology. Made with ♡ to help students excel.` ,
36
- images : [ { url : "/papers.png" } ] ,
37
- } ,
38
- applicationName : "Papers by CodeChef-VIT" ,
39
- keywords : [
40
- "CodeChef" ,
41
- "VIT" ,
42
- "Vellore Institute of Technology" ,
43
- "CodeChef-VIT" ,
44
- "Papers" ,
45
- "Exam solutions" ,
46
- "Student resources" ,
47
- "VIT exam papers" ,
48
- "Exam preparation" ,
49
- "Previous year papers VIT" ,
50
- "VITCAT1" ,
51
- "VITCAT2" ,
52
- "VITFAT" ,
53
- "VIT CAT1 papers" ,
54
- "VIT CAT2 papers" ,
55
- "VIT FAT papers" ,
56
- "VIT exam question papers" ,
57
- "VIT question bank" ,
58
- "VIT previous year question papers" ,
59
- "VIT academic resources" ,
60
- "VIT exam pattern" ,
61
- "VIT preparation tips" ,
62
- "VIT question solutions" ,
63
- "VIT model papers" ,
64
- "VIT solved papers" ,
65
- "VIT test papers" ,
66
- "VIT sample papers" ,
67
- "VIT question papers with solutions" ,
68
- "VIT exam guide" ,
69
- "VIT CAT1 preparation" ,
70
- "VIT CAT2 preparation" ,
71
- "VIT FAT preparation" ,
72
- "VIT previous year CAT1 papers" ,
73
- "VIT previous year CAT2 papers" ,
74
- "VIT previous year FAT papers" ,
75
- "VIT exam resources" ,
76
- "VIT academic help" ,
77
- "VIT syllabus" ,
78
- "VIT question paper pattern" ,
79
- "VIT 2023 papers" ,
80
- "VIT 2024 papers" ,
81
- "VIT exam practice" ,
82
- "VIT question paper archives" ,
83
- "VIT study materials" ,
84
- "VIT engineering papers" ,
85
- "VIT exam strategy" ,
86
- "VIT online exam resources" ,
87
- "VIT question paper download" ,
88
- "VIT important questions" ,
89
- "VIT question paper solutions" ,
90
- `${ paper . subject } question paper` ,
91
- `${ paper . exam } question paper` ,
92
- `${ paper . slot } question paper` ,
93
- `${ paper . year } question paper` ,
94
- `${ paper . subject } question paper` ,
95
- `${ paper . exam } question paper` ,
96
- `${ paper . slot } question paper` ,
97
- `${ paper . year } question paper` ,
98
- `${ paper . subject } ${ paper . exam } question paper` ,
99
- `${ paper . subject } ${ paper . slot } question paper` ,
100
- `${ paper . subject } ${ paper . year } question paper` ,
101
- `${ paper . exam } ${ paper . slot } question paper` ,
102
- `${ paper . exam } ${ paper . year } question paper` ,
103
- `${ paper . subject } ${ paper . exam } ${ paper . year } question paper` ,
104
- `${ paper . subject } ${ paper . exam } ${ paper . slot } question paper` ,
105
- `${ paper . subject } ${ paper . year } ${ paper . slot } question paper` ,
106
- `${ paper . exam } ${ paper . year } ${ paper . slot } question paper` ,
107
- `${ paper . subject } ${ paper . exam } ${ paper . year } ${ paper . slot } question paper` ,
108
- `${ paper . year } ${ paper . subject } ${ paper . slot } question paper` ,
109
- `${ paper . year } ${ paper . exam } ${ paper . subject } question paper` ,
110
- `${ paper . exam } ${ paper . subject } ${ paper . year } question paper` ,
111
- `${ paper . slot } ${ paper . subject } ${ paper . year } question paper` ,
112
- `${ paper . slot } ${ paper . exam } ${ paper . year } question paper` ,
113
- ] ,
114
- robots : "index, follow" ,
24
+ icons : [ { rel : "icon" , url : "/codechef_logo.svg" } ] ,
25
+ openGraph : {
26
+ title : `Papers | ${ paper . subject } | ${ paper . exam } | ${ paper . slot } ` ,
27
+ images : [ { url : "/papers.png" } ] ,
28
+ url : "https://papers.codechefvit.com/" ,
29
+ type : "website" ,
30
+ description : `Discover ${ paper . subject } 's question paper created by CodeChef-VIT at Vellore Institute of Technology. Made with ♡ to help students excel.` ,
31
+ siteName : "Papers by CodeChef-VIT" ,
32
+ } ,
33
+ twitter : {
34
+ card : "summary_large_image" ,
35
+ title : `Papers | ${ paper . subject } | ${ paper . exam } | ${ paper . slot } ` ,
36
+ description : `Discover ${ paper . subject } 's question paper created by CodeChef-VIT at Vellore Institute of Technology. Made with ♡ to help students excel.` ,
37
+ images : [ { url : "/papers.png" } ] ,
38
+ } ,
39
+ applicationName : "Papers by CodeChef-VIT" ,
40
+ keywords : [
41
+ "CodeChef" ,
42
+ "VIT" ,
43
+ "Vellore Institute of Technology" ,
44
+ "CodeChef-VIT" ,
45
+ "Papers" ,
46
+ "Exam solutions" ,
47
+ "Student resources" ,
48
+ "VIT exam papers" ,
49
+ "Exam preparation" ,
50
+ "Previous year papers VIT" ,
51
+ "VITCAT1" ,
52
+ "VITCAT2" ,
53
+ "VITFAT" ,
54
+ "VIT CAT1 papers" ,
55
+ "VIT CAT2 papers" ,
56
+ "VIT FAT papers" ,
57
+ "VIT exam question papers" ,
58
+ "VIT question bank" ,
59
+ "VIT previous year question papers" ,
60
+ "VIT academic resources" ,
61
+ "VIT exam pattern" ,
62
+ "VIT preparation tips" ,
63
+ "VIT question solutions" ,
64
+ "VIT model papers" ,
65
+ "VIT solved papers" ,
66
+ "VIT test papers" ,
67
+ "VIT sample papers" ,
68
+ "VIT question papers with solutions" ,
69
+ "VIT exam guide" ,
70
+ "VIT CAT1 preparation" ,
71
+ "VIT CAT2 preparation" ,
72
+ "VIT FAT preparation" ,
73
+ "VIT previous year CAT1 papers" ,
74
+ "VIT previous year CAT2 papers" ,
75
+ "VIT previous year FAT papers" ,
76
+ "VIT exam resources" ,
77
+ "VIT academic help" ,
78
+ "VIT syllabus" ,
79
+ "VIT question paper pattern" ,
80
+ "VIT 2023 papers" ,
81
+ "VIT 2024 papers" ,
82
+ "VIT exam practice" ,
83
+ "VIT question paper archives" ,
84
+ "VIT study materials" ,
85
+ "VIT engineering papers" ,
86
+ "VIT exam strategy" ,
87
+ "VIT online exam resources" ,
88
+ "VIT question paper download" ,
89
+ "VIT important questions" ,
90
+ "VIT question paper solutions" ,
91
+ `${ paper . subject } question paper` ,
92
+ `${ paper . exam } question paper` ,
93
+ `${ paper . slot } question paper` ,
94
+ `${ paper . year } question paper` ,
95
+ `${ paper . subject } question paper` ,
96
+ `${ paper . exam } question paper` ,
97
+ `${ paper . slot } question paper` ,
98
+ `${ paper . year } question paper` ,
99
+ `${ paper . subject } ${ paper . exam } question paper` ,
100
+ `${ paper . subject } ${ paper . slot } question paper` ,
101
+ `${ paper . subject } ${ paper . year } question paper` ,
102
+ `${ paper . exam } ${ paper . slot } question paper` ,
103
+ `${ paper . exam } ${ paper . year } question paper` ,
104
+ `${ paper . subject } ${ paper . exam } ${ paper . year } question paper` ,
105
+ `${ paper . subject } ${ paper . exam } ${ paper . slot } question paper` ,
106
+ `${ paper . subject } ${ paper . year } ${ paper . slot } question paper` ,
107
+ `${ paper . exam } ${ paper . year } ${ paper . slot } question paper` ,
108
+ `${ paper . subject } ${ paper . exam } ${ paper . year } ${ paper . slot } question paper` ,
109
+ `${ paper . year } ${ paper . subject } ${ paper . slot } question paper` ,
110
+ `${ paper . year } ${ paper . exam } ${ paper . subject } question paper` ,
111
+ `${ paper . exam } ${ paper . subject } ${ paper . year } question paper` ,
112
+ `${ paper . slot } ${ paper . subject } ${ paper . year } question paper` ,
113
+ `${ paper . slot } ${ paper . exam } ${ paper . year } question paper` ,
114
+ ] ,
115
+ robots : "index, follow" ,
116
+ } ;
117
+ }
118
+
119
+ return {
120
+ title : "Paper not found" ,
121
+ } ;
122
+ } catch {
123
+ return {
124
+ title : "Paper not found" ,
115
125
} ;
116
126
}
117
-
118
- return {
119
- title : "Paper not found" ,
120
- } ;
121
127
}
122
128
const PaperPage = async ( { params } : { params : { id : string } } ) => {
123
129
async function getPaper ( ) {
@@ -133,7 +139,7 @@ const PaperPage = async ({ params }: { params: { id: string } }) => {
133
139
return errorResponse ?. data ?. message ?? "Failed to fetch paper" ;
134
140
}
135
141
} else {
136
- return "An unknown error occurred" ;
142
+ return ` ${ err } ` ;
137
143
}
138
144
}
139
145
}
0 commit comments