File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " strontium" ,
3
- "version" : " 2.7.3 " ,
3
+ "version" : " 2.7.4 " ,
4
4
"description" : " Strontium is a TypeScript toolkit for High Performance API servers built for Production not Projects." ,
5
5
"main" : " lib/src/index.js" ,
6
6
"types" : " lib/src/index.d.ts" ,
Original file line number Diff line number Diff line change 1
1
import { Container } from "inversify"
2
+ import { Logger } from "../../logging" ;
2
3
import { Process } from "../../runtime"
3
4
import { ObjectValidator , ValidatedObject , isObject } from "../../validation"
4
5
@@ -26,7 +27,17 @@ export class Environment<O extends ObjectValidator> implements Process {
26
27
public async startup ( container : Container ) : Promise < void > {
27
28
container . bind ( Environment ) . toConstantValue ( this )
28
29
29
- this . validatedEnvironment = await isObject ( this . validator ) ( process . env )
30
+ try {
31
+ this . validatedEnvironment = await isObject ( this . validator ) ( process . env )
32
+ } catch ( e ) {
33
+ if ( container . isBound ( Logger ) ) {
34
+ container . get ( Logger ) . error ( "Environment validation failed!" , e )
35
+ } else {
36
+ console . error ( e )
37
+ }
38
+
39
+ throw e
40
+ }
30
41
}
31
42
32
43
public async shutdown ( container : Container ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments