Commit 0a9a9b0 1 parent 5c4e191 commit 0a9a9b0 Copy full SHA for 0a9a9b0
File tree 1 file changed +12
-4
lines changed
thehive-backend/app/services
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
package services
2
2
3
- import javax . inject .{ Inject , Singleton }
3
+ import scala . util . control . NonFatal
4
4
5
+ import javax .inject .{ Inject , Singleton }
5
6
import play .api .inject .ApplicationLifecycle
6
7
import play .api .libs .ws ._
7
8
import play .api .libs .ws .ahc .{ AhcWSClient , AhcWSClientConfig , AhcWSClientConfigParser }
@@ -92,8 +93,15 @@ class CustomWSAPI(
92
93
93
94
def withConfig (subConfig : Configuration ): CustomWSAPI = {
94
95
logger.debug(s " Override WS configuration using $subConfig" )
95
- new CustomWSAPI (
96
- Configuration (subConfig.underlying.atKey(" play" ).withFallback(config.underlying)),
97
- environment, lifecycle, mat)
96
+ try {
97
+ new CustomWSAPI (
98
+ Configuration (subConfig.underlying.atKey(" play" ).withFallback(config.underlying)),
99
+ environment, lifecycle, mat)
100
+ }
101
+ catch {
102
+ case NonFatal (e) ⇒
103
+ logger.error(s " WSAPI configuration error, use default values " , e)
104
+ this
105
+ }
98
106
}
99
107
}
You can’t perform that action at this time.
0 commit comments