You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I just started using this wonderful package to help me handle and simplify a piece of code with lots of error handling.
If possible could someone give me a review regarding my usage of fpdart in the following code extracts ?
The following pieces of code are used to automate the deployment of CI artifacts on prototypes. This is done by connecting to the device through SSH. A few details that comes up:
Every single command called necessitate error handling.
Do notation does make my composed functions (in the code bellow doSpoofService is spoofService written in Do. depositArtifact would be my next candidate for that treatment.) way more compact and readable but I do not know if I'm using it right.
My code is not strictly functional since my function access the encompassing class properties. If I'm not mistaken I would have to use some flavor of Reader to handle this properly ?
Any comment is welcome, and I wouldn't mind documenting whatever discussion comes out of this and open a PR to help improve the documentation.
The interface used by the following classes , nothing very interesting here for completion purpose:
abstractinterfaceclassDeployStrategy {
TaskEither<DeployStrategyError, Unit> execute();
Stream<String> get logStream;
}
sealedclassDeployStrategyError {
finalException? e;
finalStackTrace? s;
DeployStrategyError({
this.e,
this.s,
});
Stringget errorMessage;
}
classExecuteImplementationErrorextendsDeployStrategyError {
ExecuteImplementationError({super.e, super.s});
@overrideStringget errorMessage =>'An error occurred while using the execute() method of an implementation. With message: $e';
}
An abstract child of the base class, used to provide common functionnalities to the final implementations:
Hello, I just started using this wonderful package to help me handle and simplify a piece of code with lots of error handling.
If possible could someone give me a review regarding my usage of
fpdart
in the following code extracts ?The following pieces of code are used to automate the deployment of CI artifacts on prototypes. This is done by connecting to the device through SSH. A few details that comes up:
doSpoofService
isspoofService
written in Do.depositArtifact
would be my next candidate for that treatment.) way more compact and readable but I do not know if I'm using it right.Reader
to handle this properly ?Any comment is welcome, and I wouldn't mind documenting whatever discussion comes out of this and open a PR to help improve the documentation.
The interface used by the following classes , nothing very interesting here for completion purpose:
An abstract child of the base class, used to provide common functionnalities to the final implementations:
Of final implementation that only reuse the function provided by the abstract class:
Finnally the code is executed like this:
The text was updated successfully, but these errors were encountered: