Skip to content

Commit 5c0f6f9

Browse files
committed
Catch only OperationFailedException, instead of all Exceptions
1 parent c82db11 commit 5c0f6f9

24 files changed

+62
-48
lines changed

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_01.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ AutoStoryStats& stats = env.current_stats<AutoStoryStats>();
9393
context.wait_for_all_requests();
9494

9595
break;
96-
}catch(...){
96+
}catch(OperationFailedException&){
9797
// (void)e;
9898
first_attempt = false;
9999
context.wait_for_all_requests();
@@ -185,7 +185,7 @@ void checkpoint_02(
185185
leave_phone_to_overworld(env.program_info(), env.console, context);
186186

187187
break;
188-
}catch(...){
188+
}catch(OperationFailedException&){
189189
context.wait_for_all_requests();
190190
env.console.log("Resetting from checkpoint.");
191191
reset_game(env.program_info(), env.console, context);
@@ -278,7 +278,7 @@ void checkpoint_03(
278278
leave_box_system_to_overworld(env.program_info(), env.console, context);
279279

280280
break;
281-
}catch(...){
281+
}catch(OperationFailedException&){
282282
context.wait_for_all_requests();
283283
env.console.log("Resetting from checkpoint.");
284284
reset_game(env.program_info(), env.console, context);

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_02.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
*/
66

7+
#include "CommonFramework/Exceptions/OperationFailedException.h"
78
#include "CommonFramework/VideoPipeline/VideoOverlay.h"
89
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
910
#include "PokemonSV/Programs/PokemonSV_GameEntry.h"
@@ -93,7 +94,7 @@ void checkpoint_04(
9394
env.console.log("Finished battle.");
9495

9596
break;
96-
}catch(...){
97+
}catch(OperationFailedException&){
9798
context.wait_for_all_requests();
9899
env.console.log("Resetting from checkpoint.");
99100
reset_game(env.program_info(), env.console, context);

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_03.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
*/
66

7+
#include "CommonFramework/Exceptions/OperationFailedException.h"
78
#include "CommonFramework/VideoPipeline/VideoOverlay.h"
89
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
910
#include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h"
@@ -84,7 +85,7 @@ void checkpoint_05(
8485
env.console.overlay().add_log("Get mom's sandwich", COLOR_WHITE);
8586
mash_button_till_overworld(env.console, context);
8687
break;
87-
}catch(...){
88+
}catch(OperationFailedException&){
8889
context.wait_for_all_requests();
8990
env.console.log("Resetting from checkpoint.");
9091
reset_game(env.program_info(), env.console, context);
@@ -134,7 +135,7 @@ void checkpoint_06(
134135
env.console.overlay().add_log("Finished catch tutorial", COLOR_WHITE);
135136

136137
break;
137-
}catch(...){
138+
}catch(OperationFailedException&){
138139
context.wait_for_all_requests();
139140
env.console.log("Resetting from checkpoint.");
140141
reset_game(env.program_info(), env.console, context);
@@ -188,7 +189,7 @@ void checkpoint_07(
188189
env.console.overlay().add_log("Mystery cry", COLOR_WHITE);
189190

190191
break;
191-
}catch(...){
192+
}catch(OperationFailedException&){
192193
context.wait_for_all_requests();
193194
env.console.log("Resetting from checkpoint.");
194195
reset_game(env.program_info(), env.console, context);

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_04.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ void checkpoint_08(
193193
mash_button_till_overworld(env.console, context, BUTTON_A);
194194

195195
break;
196-
}catch(...){
196+
}catch(OperationFailedException&){
197197
context.wait_for_all_requests();
198198
env.console.log("Resetting from checkpoint.");
199199
reset_game(env.program_info(), env.console, context);

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_05.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
*/
66

7+
#include "CommonFramework/Exceptions/OperationFailedException.h"
78
#include "CommonFramework/VideoPipeline/VideoOverlay.h"
89
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
910
#include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h"
@@ -101,7 +102,7 @@ void checkpoint_09(
101102
env.console.overlay().add_log("Receive legendary ball", COLOR_WHITE);
102103

103104
break;
104-
}catch(...){
105+
}catch(OperationFailedException&){
105106
context.wait_for_all_requests();
106107
env.console.log("Resetting from checkpoint.");
107108
reset_game(env.program_info(), env.console, context);
@@ -143,7 +144,7 @@ void checkpoint_10(
143144
mash_button_till_overworld(env.console, context, BUTTON_A);
144145

145146
break;
146-
}catch(...){
147+
}catch(OperationFailedException&){
147148
context.wait_for_all_requests();
148149
env.console.log("Resetting from checkpoint.");
149150
reset_game(env.program_info(), env.console, context);

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_06.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
*/
66

7+
#include "CommonFramework/Exceptions/OperationFailedException.h"
78
#include "CommonFramework/VideoPipeline/VideoOverlay.h"
89
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
910
#include "PokemonSV/Inference/PokemonSV_TutorialDetector.h"
@@ -109,7 +110,7 @@ void checkpoint_11(
109110
env.console.overlay().add_log("Reached Los Platos", COLOR_WHITE);
110111

111112
break;
112-
}catch(...){
113+
}catch(OperationFailedException&){
113114
context.wait_for_all_requests();
114115
env.console.log("Resetting from checkpoint.");
115116
reset_game(env.program_info(), env.console, context);

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_07.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
*/
66

7+
#include "CommonFramework/Exceptions/OperationFailedException.h"
78
#include "CommonFramework/VideoPipeline/VideoOverlay.h"
89
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
910
#include "PokemonSV/Inference/Overworld/PokemonSV_DirectionDetector.h"
@@ -120,7 +121,7 @@ void checkpoint_12(
120121
env.console.log("Reached Mesagoza (South) Pokecenter.");
121122

122123
break;
123-
}catch(...){
124+
}catch(OperationFailedException&){
124125
context.wait_for_all_requests();
125126
env.console.log("Resetting from checkpoint.");
126127
reset_game(env.program_info(), env.console, context);

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_08.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
*/
66

7+
#include "CommonFramework/Exceptions/OperationFailedException.h"
78
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
89
#include "PokemonSV/Inference/PokemonSV_TutorialDetector.h"
910
#include "PokemonSV/Programs/PokemonSV_GameEntry.h"
@@ -100,7 +101,7 @@ void checkpoint_13(
100101

101102

102103
break;
103-
}catch(...){
104+
}catch(OperationFailedException&){
104105
context.wait_for_all_requests();
105106
env.console.log("Resetting from checkpoint.");
106107
reset_game(env.program_info(), env.console, context);
@@ -158,7 +159,7 @@ void checkpoint_14(
158159
clear_dialog(env.console, context, ClearDialogMode::STOP_OVERWORLD, 60, {CallbackEnum::OVERWORLD});
159160

160161
break;
161-
}catch(...){
162+
}catch(OperationFailedException&){
162163
context.wait_for_all_requests();
163164
env.console.log("Resetting from checkpoint.");
164165
reset_game(env.program_info(), env.console, context);
@@ -201,7 +202,7 @@ void checkpoint_15(
201202
{CallbackEnum::PROMPT_DIALOG, CallbackEnum::OVERWORLD});
202203

203204
break;
204-
}catch(...){
205+
}catch(OperationFailedException&){
205206
context.wait_for_all_requests();
206207
env.console.log("Resetting from checkpoint.");
207208
reset_game(env.program_info(), env.console, context);

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_09.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
*/
66

7+
#include "CommonFramework/Exceptions/OperationFailedException.h"
78
#include "CommonFramework/VideoPipeline/VideoOverlay.h"
89
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
910
#include "PokemonSV/Inference/PokemonSV_TutorialDetector.h"
@@ -105,7 +106,7 @@ void checkpoint_16(
105106

106107

107108
break;
108-
}catch(...){
109+
}catch(OperationFailedException&){
109110
context.wait_for_all_requests();
110111
env.console.log("Resetting from checkpoint.");
111112
reset_game(env.program_info(), env.console, context);
@@ -160,7 +161,7 @@ void checkpoint_17(
160161

161162

162163
break;
163-
}catch(...){
164+
}catch(OperationFailedException&){
164165
context.wait_for_all_requests();
165166
env.console.log("Resetting from checkpoint.");
166167
reset_game(env.program_info(), env.console, context);
@@ -206,7 +207,7 @@ void checkpoint_18(
206207
{CallbackEnum::OVERWORLD, CallbackEnum::PROMPT_DIALOG});
207208

208209
break;
209-
}catch(...){
210+
}catch(OperationFailedException&){
210211
context.wait_for_all_requests();
211212
env.console.log("Resetting from checkpoint.");
212213
reset_game(env.program_info(), env.console, context);
@@ -250,7 +251,7 @@ void checkpoint_19(
250251

251252

252253
break;
253-
}catch(...){
254+
}catch(OperationFailedException&){
254255
context.wait_for_all_requests();
255256
env.console.log("Resetting from checkpoint.");
256257
reset_game(env.program_info(), env.console, context);
@@ -303,7 +304,7 @@ void checkpoint_20(
303304
mash_button_till_overworld(env.console, context, BUTTON_A, 360);
304305

305306
break;
306-
}catch(...){
307+
}catch(OperationFailedException&){
307308
context.wait_for_all_requests();
308309
env.console.log("Resetting from checkpoint.");
309310
reset_game(env.program_info(), env.console, context);

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_10.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void checkpoint_21(
117117
fly_to_overlapping_flypoint(env.program_info(), env.console, context);
118118

119119
break;
120-
}catch(...){
120+
}catch(OperationFailedException&){
121121
context.wait_for_all_requests();
122122
env.console.log("Resetting from checkpoint.");
123123
reset_game(env.program_info(), env.console, context);
@@ -184,7 +184,7 @@ void checkpoint_22(
184184
fly_to_overlapping_flypoint(env.program_info(), env.console, context);
185185

186186
break;
187-
}catch(...){
187+
}catch(OperationFailedException&){
188188
context.wait_for_all_requests();
189189
env.console.log("Resetting from checkpoint.");
190190
reset_game(env.program_info(), env.console, context);
@@ -303,7 +303,7 @@ void checkpoint_23(
303303
fly_to_overlapping_flypoint(env.program_info(), env.console, context);
304304

305305
break;
306-
}catch(...){
306+
}catch(OperationFailedException&){
307307
context.wait_for_all_requests();
308308
env.console.log("Resetting from checkpoint.");
309309
reset_game(env.program_info(), env.console, context);

0 commit comments

Comments
 (0)