Skip to content

Comments

Assignment-5 added#4

Open
nitintayal008 wants to merge 5 commits intomainfrom
Assignment-5
Open

Assignment-5 added#4
nitintayal008 wants to merge 5 commits intomainfrom
Assignment-5

Conversation

@nitintayal008
Copy link
Owner

No description provided.

}

function handleNatureRelatedAccident() {
callAmbulance();
Copy link
Collaborator

@Poyam-ITT Poyam-ITT Apr 2, 2024

Choose a reason for hiding this comment

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

The method callAmbulance is common in multiple exceptions, please check if we can move it to finally or have an alternate solution

Copy link
Owner Author

Choose a reason for hiding this comment

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

No , it is only in 3 exceptions and also finally block will execute, irrespective of whether or not an accident occurs, so we can't call ambulance in finally .

Copy link
Collaborator

Choose a reason for hiding this comment

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

So in that case, please add the positive scenario condition also where no exception is there and the car reaches the destination safely.

}

function driveCar() {
const isCarBreakFail = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cannot we use enums here?

Copy link
Collaborator

@mukulpalol16 mukulpalol16 left a comment

Choose a reason for hiding this comment

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

Wouldn't it be better if you make a class in CareDrive.ts file and have the try-catch there to also be able to maintian SRP?

Repository owner deleted a comment from mukulpalol16 Apr 3, 2024
Repository owner deleted a comment from mukulpalol16 Apr 3, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess there is a typo. It should be ErrorHandler.ts

@@ -0,0 +1,94 @@
import { Actions } from './ErrorHanler';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Check for the typo in the file name

@nansi-maheshwari-ITT nansi-maheshwari-ITT self-requested a review April 3, 2024 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants