Skip to content

Commit 819a8f5

Browse files
authored
Merge pull request #663 from schauder/master
Remove usage of NestedIOException.
2 parents bc96057 + 30b395a commit 819a8f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2021 the original author or authors.
2+
* Copyright 2010-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -58,7 +58,6 @@
5858
import org.springframework.context.ApplicationListener;
5959
import org.springframework.context.ConfigurableApplicationContext;
6060
import org.springframework.context.event.ContextRefreshedEvent;
61-
import org.springframework.core.NestedIOException;
6261
import org.springframework.core.io.Resource;
6362
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
6463
import org.springframework.core.io.support.ResourcePatternResolver;
@@ -82,6 +81,7 @@
8281
* @author Eduardo Macarron
8382
* @author Eddú Meléndez
8483
* @author Kazuki Shimizu
84+
* @author Jens Schauder
8585
*
8686
* @see #setConfigLocation
8787
* @see #setDataSource
@@ -576,7 +576,7 @@ protected SqlSessionFactory buildSqlSessionFactory() throws Exception {
576576
try {
577577
targetConfiguration.setDatabaseId(this.databaseIdProvider.getDatabaseId(this.dataSource));
578578
} catch (SQLException e) {
579-
throw new NestedIOException("Failed getting a databaseId", e);
579+
throw new IOException("Failed getting a databaseId", e);
580580
}
581581
}
582582

@@ -587,7 +587,7 @@ protected SqlSessionFactory buildSqlSessionFactory() throws Exception {
587587
xmlConfigBuilder.parse();
588588
LOGGER.debug(() -> "Parsed configuration file: '" + this.configLocation + "'");
589589
} catch (Exception ex) {
590-
throw new NestedIOException("Failed to parse config resource: " + this.configLocation, ex);
590+
throw new IOException("Failed to parse config resource: " + this.configLocation, ex);
591591
} finally {
592592
ErrorContext.instance().reset();
593593
}
@@ -610,7 +610,7 @@ protected SqlSessionFactory buildSqlSessionFactory() throws Exception {
610610
targetConfiguration, mapperLocation.toString(), targetConfiguration.getSqlFragments());
611611
xmlMapperBuilder.parse();
612612
} catch (Exception e) {
613-
throw new NestedIOException("Failed to parse mapping resource: '" + mapperLocation + "'", e);
613+
throw new IOException("Failed to parse mapping resource: '" + mapperLocation + "'", e);
614614
} finally {
615615
ErrorContext.instance().reset();
616616
}

0 commit comments

Comments
 (0)