dice icon indicating copy to clipboard operation
dice copied to clipboard

Stanardize/Refactor error

Open soumya-codes opened this issue 1 year ago • 4 comments

As the repo size grows in volume it is important to standardize on the errors. We need to make sure that the shared/common errors are well-defined at one place and reused for different/appropriate use-cases. Currently the same error is being replicated across multiple places. For example the error for wrong syntax(ERR syntax error) is duplicated across at-least 9 places.

Please check here to see how Redis handles common messages.

Important: Please ensure we use idiomatic go practices while refactoring the code.

Expected behavior

The existing functionality shouldn't get effected and all test-cases should pass.

soumya-codes avatar Aug 06 '24 09:08 soumya-codes

@soumya-codes would like to work on this.

lucifercr07 avatar Aug 06 '24 09:08 lucifercr07

@lucifercr07 thanks, go for this. @JyotinderSingh please assign.

soumya-codes avatar Aug 06 '24 09:08 soumya-codes

Hey @lucifercr07 , may we collaborate on this issue?

yaten2302 avatar Aug 06 '24 09:08 yaten2302

@soumya-codes would like to work on this.

Assigned

JyotinderSingh avatar Aug 06 '24 12:08 JyotinderSingh

@lucifercr07 -

This function creates a new DiceError but returns only its message field, losing the custom error type.

func NewErr(message string) error { return newDiceErr(message).message }

Why not use : func NewErr(message string) error { return newDiceErr(message) }

pb2582528 avatar Oct 10 '24 17:10 pb2582528