Wrap panics that occur in AndroidMkDataProviders

am: 953d3a2b28

Change-Id: Ieecee223712e3968eb0ddad6c4d4cca5596da822
This commit is contained in:
Colin Cross 2018-09-06 19:56:25 -07:00 committed by android-build-merger
commit f322c5f0ee
1 changed files with 7 additions and 0 deletions

View File

@ -141,6 +141,13 @@ func translateAndroidMk(ctx SingletonContext, mkFile string, mods []Module) erro
}
func translateAndroidMkModule(ctx SingletonContext, w io.Writer, mod blueprint.Module) error {
defer func() {
if r := recover(); r != nil {
panic(fmt.Errorf("%s in translateAndroidMkModule for module %s variant %s",
r, ctx.ModuleName(mod), ctx.ModuleSubDir(mod)))
}
}()
provider, ok := mod.(AndroidMkDataProvider)
if !ok {
return nil