Skip to content

Commit df5e5f5

Browse files
committed
fix(handler): bind this into uncaught handler
1 parent 466812c commit df5e5f5

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/core",
3-
"version": "5.39.0",
3+
"version": "5.40.0",
44
"description": "One foundation for multiple applications.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",

src/ignite/Ignite.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class Ignite extends Macroable {
9191
exitOnUncaughtError: false,
9292
loadConfigSafe: true,
9393
athennaRcPath: './.athennarc.json',
94-
uncaughtExceptionHandler: this.handleUncaughtError
94+
uncaughtExceptionHandler: this.handleUncaughtError.bind(this)
9595
})
9696

9797
this.setUncaughtExceptionHandler()
@@ -218,6 +218,8 @@ export class Ignite extends Macroable {
218218
* providers and preload files.
219219
*/
220220
public async fire(forceIgniteFire?: boolean) {
221+
Config.set('rc.environments', this.options.environments)
222+
221223
if (this.hasFired && !forceIgniteFire) {
222224
debug(
223225
'application already fired. if you need to refire use forceIgniteFire option in your application bootstrap.'
@@ -232,7 +234,7 @@ export class Ignite extends Macroable {
232234
this.setEnvVariablesFile()
233235
await this.setConfigurationFiles()
234236

235-
Config.push('rc.environments', this.options.environments)
237+
Config.set('rc.environments', this.options.environments)
236238

237239
await LoadHelper.regootProviders()
238240
await LoadHelper.preloadFiles()

0 commit comments

Comments
 (0)