Clpsplug / Clpsplug/UniSwitcher

ArgumentException from `ISceneEntryPoint.Validate` should be handleable

Open
#15 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
C#
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Is your feature request related to a problem? Please describe.
Current implementation of `ISceneEntryPoint.Validate()` crashes the game with an `ArgumentException` if its validation fails.

Some users may want to use the `ISceneEntryPoint.Validate()` method to validate the data sent from another scene in their production code. However, since the `Validate()` method results in an unhandled `ArgumentException,` they cannot implement any fail-safe.

## Describe the solution you'd like
Move this part of the `BootStrapper` class into the following `try` block:

https://github.com/Clpsplug/UniSwitcher/blob/a778df8fad7682b7234100adf3f1abe62f421c59/Assets/Plugins/UniSwitcher/Infra/Bootstrapper.cs#L33-L39

## Describe alternatives you've considered
**Deprecate the `Validate()` method entirely.**
The Entry Point can exist without referencing the data the other Scene has sent. The user could just validate the data in the `Fire()` method (whose exceptions can be handled) or validate it before its transfer.

## Additional context
N/A

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.