In Application, change sitemap() to main_menu() and provide a default implementation, based on the boilerplate we have in most apps. Remove the sidebar_menu() as children, it's not needed. Remove h.exceptionless, and add try/catch where sitemap/main_menu is invoked.
Update every app to return [] if they had no sitemap() before, delete if they were using the boilerplate, or keep using custom code.
Some of this was improved in [#6391]
Related
Tickets:
#6391