File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 88use Illuminate \Contracts \Http \Kernel ;
99use Psr \Container \ContainerInterface ;
1010use Psr \Http \Server \RequestHandlerInterface ;
11+ use Runtime \Bref \Lambda \LambdaClient ;
1112use Symfony \Component \Console \Application ;
1213use Symfony \Component \DependencyInjection \Exception \ServiceNotFoundException ;
1314use Symfony \Component \HttpKernel \HttpKernelInterface ;
@@ -32,6 +33,20 @@ public function __construct(array $options = [])
3233 }
3334
3435 public function getRunner (?object $ application ): RunnerInterface
36+ {
37+ try {
38+ return $ this ->tryToFindRunner ($ application );
39+ } catch (\Throwable $ e ) {
40+ if ('aws ' === $ this ->options ['bref_runner_type ' ]) {
41+ $ lambda = LambdaClient::fromEnvironmentVariable ('symfony-runtime ' );
42+ $ lambda ->failInitialization ('Could not get the Runtime runner. ' , $ e );
43+ }
44+
45+ throw $ e ;
46+ }
47+ }
48+
49+ private function tryToFindRunner (?object $ application )
3550 {
3651 if ($ application instanceof ContainerInterface) {
3752 $ handler = explode (': ' , $ _SERVER ['_HANDLER ' ]);
You can’t perform that action at this time.
0 commit comments