Skip to content

Commit 2713ba0

Browse files
committed
fix: removed some stuff that was not meant to be there
1 parent bd3cf79 commit 2713ba0

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ jsonStr := khata.ToJSON()
152152

153153
Khata also provides a way to create error templates. Those can be very powerful when you need to create multiple errors with the same context. To create a template, you can use the `khata.NewTemplate` function. It returns a reference to the newly created template object. From the template object, you can use the following methods to generate errors:
154154

155-
- `New() *Khata`: Generates a new khata error from the template.
156-
- `NewWithMessage(message string) *Khata`: Generates a new khata error from the template with given message.
155+
- `New(message ...string) *Khata`: Generates a new khata error from the template.
157156
- `Wrap(err error) *Khata`: Wraps an error with the template.
158157

159158
```go

khata.go

-5
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ type KhataTemplate struct {
6969
parent *KhataTemplate
7070
}
7171

72-
// Create a new khata error with the template and given message
73-
func (kt *KhataTemplate) NewWithMessage(message string) *Khata {
74-
return kt.Wrap(errors.New(message))
75-
}
76-
7772
// Create a new khata error with the template
7873
func (kt *KhataTemplate) New(message ...string) *Khata {
7974
var inputMessage string

0 commit comments

Comments
 (0)