You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -37,9 +38,15 @@ public function getRunner(?object $application): RunnerInterface
37
38
if ($applicationinstanceof ContainerInterface) {
38
39
$handler = explode(':', $_SERVER['_HANDLER']);
39
40
if (!isset($handler[1]) || '' === $handler[1]) {
40
-
thrownew \RuntimeException(sprintf('Application is instance of ContainerInterface but the handler does not contain a service. The handler must be on format "path/to/file.php:App\\Lambda\\MyHandler". You provided "%s".', $_SERVER['_HANDLER']));
41
+
// We assume that $handler[0] is your service name, ie you are using FALLBACK_CONTAINER_FILE
42
+
$handler[1] = $handler[0];
43
+
}
44
+
45
+
try {
46
+
$application = $application->get($handler[1]);
47
+
} catch (ServiceNotFoundException$e) {
48
+
thrownew \RuntimeException(sprintf('Application is instance of ContainerInterface but the service is not found. The handler must be on format "path/to/file.php:App\\Lambda\\MyHandler". You provided "%s".', $_SERVER['_HANDLER']), 0, $e);
0 commit comments