Wrap panics that occur in AndroidMkDataProviders

Annotate panics that come from an AndroidMkDataProvider with the
module and variant that it was running on.

Test: m checkbuild
Change-Id: I4a2f32b1987dc028c446e9379a0738059e7679b1
This commit is contained in:
Colin Cross
2018-09-05 16:23:54 -07:00
parent 37710d3c71
commit 953d3a2b28

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