Skip to content

Make UI not fully fail to initialise for single Item throwing exception - #568

Merged
IsakNaslundBh merged 2 commits into
developfrom
BHoM_UI-#567-ProtectAgainstSingleFailingCodeItemCausingFullFailureOfUILoad
Sep 16, 2026
Merged

IsakNaslundBh merged 2 commits into
developfrom
BHoM_UI-#567-ProtectAgainstSingleFailingCodeItemCausingFullFailureOfUILoad

Conversation

@IsakNaslundBh

@IsakNaslundBh IsakNaslundBh commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Issues addressed by this PR

Closes #567

Try-catch blocks on CodeElement methods
Also requiring additional nullfiltering to avoid adding nulls to the list

Test files

See BHoM/BHoM_Engine#3614 for example method to test with.

Test by adding the method to one of the Engines in the BHoM_Engine. Preferably a discipline engine (like structures or similar) that is not directly used by grasshopper. After rebuilding with BHoM_UI on develop (before this fix) you should get full load failure on the UI side when initialising grasshopper/excel.

Then rebuild BHoM_UI on this branch, and if testing with Grasshopper then you also need to rebuild Grasshopper_UI. After that the BHoM should load, and you should find a record in the startup events stating that the method failed to initialise.

image

Changelog

  • Try-catch blocks in code element to avoid full crash on single failure on initialisation

Additional comments

Also requiring additional nullfiltering to avoid adding nulls to the list
@IsakNaslundBh

Copy link
Copy Markdown
Contributor Author

@BHoMBot check installer

@bhombot-ci

bhombot-ci Bot commented Sep 16, 2026

Copy link
Copy Markdown

@IsakNaslundBh to confirm, the following actions are now queued:

  • check installer

@IsakNaslundBh

Copy link
Copy Markdown
Contributor Author

@BHoMBot check copyright-compliance
@BHoMBot check core
@BHoMBot check project-compliance
@BHoMBot check versioning

@bhombot-ci

bhombot-ci Bot commented Sep 16, 2026

Copy link
Copy Markdown

@IsakNaslundBh to confirm, the following actions are now queued:

  • check copyright-compliance
  • check core
  • check project-compliance
  • check versioning

@peterjamesnugent peterjamesnugent added the type:bug Error or unexpected behaviour label Sep 16, 2026

@peterjamesnugent peterjamesnugent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested using the provided installer - error is caught successfully (by calling AllEvents() and FilterByProperty to see EventType.Error and importantly the UI does not fail to load.

@peterjamesnugent

Copy link
Copy Markdown
Member

@BHoMBot check ready-to-merge

@bhombot-ci

bhombot-ci Bot commented Sep 16, 2026

Copy link
Copy Markdown

@peterjamesnugent to confirm, the following actions are now queued:

  • check ready-to-merge

There are 21 requests in the queue ahead of you.

@IsakNaslundBh
IsakNaslundBh merged commit 5a69104 into develop Sep 16, 2026
15 checks passed
@IsakNaslundBh
IsakNaslundBh deleted the BHoM_UI-#567-ProtectAgainstSingleFailingCodeItemCausingFullFailureOfUILoad branch September 16, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Error or unexpected behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protect against a single failing code element bringing down the whole BHoM loading system.

2 participants