DoclerLabs / hexMachina

Releases, issues, documentation, website of hexMachina, framework written in Haxe
http://hexmachina.org
MIT License
44 stars 8 forks source link

[hexinject, HTML5] uncaught exceptions are no being logged to console, if it happens during getInstance #311

Open CrazyFlasher opened 4 years ago

CrazyFlasher commented 4 years ago

Simple example

var instance:MyCoolInstance  = injector.instantiateUnmapped(MyCoolInstance);
...
class MyCoolInstance
{
     @PostConstruct
     public function init():Void
     {
           throw new Error("error);
     }
}

UPD: What is the reason of bottom catch of instantiateUnmapped in Injector?

try
        {
            if ( instance.acceptInjector != null )
            {
                this._applyInjection( instance, type );
            }
        }
        catch ( e : MissingMappingException )
        {
            throw( e );
        }
        catch ( e : Dynamic )
        {
            //Do nothing
        }
CrazyFlasher commented 4 years ago

https://github.com/DoclerLabs/hexInject/pull/80