Closed JesseTG closed 1 year ago
It seems that's only the case for PrepareBuild
? If an option throws an exception in PrepareBuild
or the exception on Manager.cs#L474 is hit, OnBuildError
won't be called.
But for the native Unity events like OnPreprocessBuild
and OnProcessScene
, the exception should be reported by Unity as an error in the build report. Or are there cases where Unity allows the exception to reach BuildSync
?
It seems the main challenge is that we don't have a BuildReport
at that time and cannot create one. So the OnBuildError
has to be changed to include an additional error parameter and pass null
for the report.
I think I made the assumption that OnBuildError
wouldn't be reached from the other build phases. PrepareBuild
is indeed the only one I've actually observed.
I'll go ahead and send a PR for that suggested change later today.
OnBuildError
is called ifBuildPipeline.BuildPlayer
(called withinBuildSync
) fails. The same cannot be said ifPrepareBuild
fails.