6
6
7
7
import com .amazonaws .services .lambda .runtime .Context ;
8
8
import com .amazonaws .services .lambda .runtime .events .CloudFormationCustomResourceEvent ;
9
+ import java .io .IOException ;
9
10
import java .nio .file .Files ;
10
11
import java .nio .file .Path ;
11
12
import java .util .LinkedList ;
12
13
import java .util .Map ;
13
14
import org .apache .logging .log4j .LogManager ;
14
15
import org .apache .logging .log4j .Logger ;
16
+ import org .jooq .exception .DataAccessException ;
15
17
import org .jooq .impl .DSL ;
16
18
import software .amazon .lambda .powertools .cloudformation .AbstractCustomResourceHandler ;
17
19
import software .amazon .lambda .powertools .cloudformation .Response ;
@@ -46,7 +48,7 @@ protected Response create(CloudFormationCustomResourceEvent cfcre, Context cntxt
46
48
for (var file : sqlFiles ) {
47
49
try {
48
50
dsl .execute (Files .readString (Path .of (task_root , "scripts" , file )));
49
- } catch (Exception e ) {
51
+ } catch (IOException | DataAccessException e ) {
50
52
log .error ("Error processing SQL file " + file , e );
51
53
}
52
54
}
@@ -60,7 +62,7 @@ protected Response create(CloudFormationCustomResourceEvent cfcre, Context cntxt
60
62
.execute ();
61
63
62
64
63
- } catch (Exception e ) {
65
+ } catch (DataAccessException e ) {
64
66
log .error ("Could Not Process SQL Files" , e );
65
67
}
66
68
return Response .builder ()
0 commit comments