Skip to content

Commit 65fd47c

Browse files
committed
Improve error reporting.
* All error messages start with a lower-case letter. * Errors are formatted with the `%w` specifier, which wraps them. * All other warnings are fixed.
1 parent 3a37685 commit 65fd47c

31 files changed

+494
-486
lines changed

array.go

+42-41
Large diffs are not rendered by default.

array_experimental.go

+9-8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package tiledb
77
*/
88
import "C"
99
import (
10+
"errors"
1011
"fmt"
1112
"runtime"
1213
"unsafe"
@@ -27,7 +28,7 @@ func GetConsolidationPlan(arr *Array, fragmentSize uint64) (*ConsolidationPlan,
2728

2829
ret := C.tiledb_consolidation_plan_create_with_mbr(cp.context.tiledbContext, arr.tiledbArray, C.uint64_t(fragmentSize), &cp.tiledbConsolidationPlan)
2930
if ret != C.TILEDB_OK {
30-
return nil, fmt.Errorf("Error getting consolidation plan for array: %s", cp.context.LastError())
31+
return nil, fmt.Errorf("error getting consolidation plan for array: %w", cp.context.LastError())
3132
}
3233
freeOnGC(cp)
3334

@@ -51,7 +52,7 @@ func (cp *ConsolidationPlan) NumNodes() (uint64, error) {
5152

5253
ret := C.tiledb_consolidation_plan_get_num_nodes(cp.context.tiledbContext, cp.tiledbConsolidationPlan, &numNodes)
5354
if ret != C.TILEDB_OK {
54-
return 0, fmt.Errorf("Error getting consolidation plan num nodes: %s", cp.context.LastError())
55+
return 0, fmt.Errorf("error getting consolidation plan num nodes: %w", cp.context.LastError())
5556
}
5657

5758
return uint64(numNodes), nil
@@ -63,7 +64,7 @@ func (cp *ConsolidationPlan) NumFragments(nodeIndex uint64) (uint64, error) {
6364

6465
ret := C.tiledb_consolidation_plan_get_num_fragments(cp.context.tiledbContext, cp.tiledbConsolidationPlan, C.uint64_t(nodeIndex), &numFragments)
6566
if ret != C.TILEDB_OK {
66-
return 0, fmt.Errorf("Error getting consolidation plan num fragments: %s", cp.context.LastError())
67+
return 0, fmt.Errorf("error getting consolidation plan num fragments: %w", cp.context.LastError())
6768
}
6869

6970
return uint64(numFragments), nil
@@ -75,7 +76,7 @@ func (cp *ConsolidationPlan) FragmentURI(nodeIndex, fragmentIndex uint64) (strin
7576

7677
ret := C.tiledb_consolidation_plan_get_fragment_uri(cp.context.tiledbContext, cp.tiledbConsolidationPlan, C.uint64_t(nodeIndex), C.uint64_t(fragmentIndex), &curi)
7778
if ret != C.TILEDB_OK {
78-
return "", fmt.Errorf("Error getting consolidation plan fragment uri for node %d and fragment %d: %s", nodeIndex, fragmentIndex, cp.context.LastError())
79+
return "", fmt.Errorf("error getting consolidation plan fragment uri for node %d and fragment %d: %w", nodeIndex, fragmentIndex, cp.context.LastError())
7980
}
8081

8182
return C.GoString(curi), nil
@@ -86,14 +87,14 @@ func (cp *ConsolidationPlan) DumpJSON() (string, error) {
8687
var cjson *C.char
8788
ret := C.tiledb_consolidation_plan_dump_json_str(cp.context.tiledbContext, cp.tiledbConsolidationPlan, &cjson)
8889
if ret != C.TILEDB_OK {
89-
return "", fmt.Errorf("Error getting consolidation plan json dump: %s", cp.context.LastError())
90+
return "", fmt.Errorf("error getting consolidation plan json dump: %w", cp.context.LastError())
9091
}
9192

9293
json := C.GoString(cjson)
9394

9495
ret = C.tiledb_consolidation_plan_free_json_str(&cjson)
9596
if ret != C.TILEDB_OK {
96-
return "", fmt.Errorf("Error getting consolidation plan json dump: %s", cp.context.LastError())
97+
return "", fmt.Errorf("error getting consolidation plan json dump: %w", cp.context.LastError())
9798
}
9899

99100
return json, nil
@@ -104,7 +105,7 @@ func (cp *ConsolidationPlan) DumpJSON() (string, error) {
104105
// begin (as consolidation temporarily acquires an exclusive lock on the array).
105106
func (a *Array) ConsolidateFragments(config *Config, fragmentList []string) error {
106107
if config == nil {
107-
return fmt.Errorf("Config must not be nil for Consolidate")
108+
return errors.New("config must not be nil for Consolidate")
108109
}
109110

110111
curi := C.CString(a.uri)
@@ -115,7 +116,7 @@ func (a *Array) ConsolidateFragments(config *Config, fragmentList []string) erro
115116

116117
ret := C.tiledb_array_consolidate_fragments(a.context.tiledbContext, curi, (**C.char)(slicePtr(list)), C.uint64_t(len(list)), config.tiledbConfig)
117118
if ret != C.TILEDB_OK {
118-
return fmt.Errorf("Error consolidating tiledb array fragment list: %s", a.context.LastError())
119+
return fmt.Errorf("error consolidating tiledb array fragment list: %w", a.context.LastError())
119120
}
120121

121122
runtime.KeepAlive(config)

array_schema.go

+32-32
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type ArraySchema struct {
3232
func (a *ArraySchema) MarshalJSON() ([]byte, error) {
3333
bs, err := SerializeArraySchema(a, TILEDB_JSON, false)
3434
if err != nil {
35-
return nil, fmt.Errorf("Error marshaling json for array schema: %s", a.context.LastError())
35+
return nil, fmt.Errorf("error marshaling json for array schema: %w", a.context.LastError())
3636
}
3737
return bs, nil
3838
}
@@ -67,19 +67,19 @@ func (a *ArraySchema) UnmarshalJSON(b []byte) error {
6767
// Wrap the input byte slice in a Buffer (does not copy)
6868
buffer, err := NewBuffer(a.context)
6969
if err != nil {
70-
return fmt.Errorf("Error unmarshaling json for array schema: %s", a.context.LastError())
70+
return fmt.Errorf("error unmarshaling json for array schema: %w", a.context.LastError())
7171
}
7272
err = buffer.SetBuffer(bytesWithNullTerminator)
7373
if err != nil {
74-
return fmt.Errorf("Error unmarshaling json for array schema: %s", a.context.LastError())
74+
return fmt.Errorf("error unmarshaling json for array schema: %w", a.context.LastError())
7575
}
7676

7777
// Deserialize into a new array schema
7878
var newCSchema *C.tiledb_array_schema_t
7979
var cClientSide = C.int32_t(0) // Currently this parameter is unused in libtiledb
8080
ret := C.tiledb_deserialize_array_schema(a.context.tiledbContext, buffer.tiledbBuffer, C.TILEDB_JSON, cClientSide, &newCSchema)
8181
if ret != C.TILEDB_OK {
82-
return fmt.Errorf("Error deserializing array schema: %s", a.context.LastError())
82+
return fmt.Errorf("error deserializing array schema: %w", a.context.LastError())
8383
}
8484

8585
// Replace the C schema object with the deserialized one.
@@ -96,7 +96,7 @@ func NewArraySchema(tdbCtx *Context, arrayType ArrayType) (*ArraySchema, error)
9696
arraySchema := ArraySchema{context: tdbCtx}
9797
ret := C.tiledb_array_schema_alloc(arraySchema.context.tiledbContext, C.tiledb_array_type_t(arrayType), &arraySchema.tiledbArraySchema)
9898
if ret != C.TILEDB_OK {
99-
return nil, fmt.Errorf("Error creating tiledb arraySchema: %s", arraySchema.context.LastError())
99+
return nil, fmt.Errorf("error creating tiledb arraySchema: %w", arraySchema.context.LastError())
100100
}
101101
freeOnGC(&arraySchema)
102102
return &arraySchema, nil
@@ -118,7 +118,7 @@ func (a *ArraySchema) AddAttributes(attributes ...*Attribute) error {
118118
for _, attribute := range attributes {
119119
ret := C.tiledb_array_schema_add_attribute(a.context.tiledbContext, a.tiledbArraySchema, attribute.tiledbAttribute)
120120
if ret != C.TILEDB_OK {
121-
return fmt.Errorf("Error adding attributes to tiledb arraySchema: %s", a.context.LastError())
121+
return fmt.Errorf("error adding attributes to tiledb arraySchema: %w", a.context.LastError())
122122
}
123123
}
124124
return nil
@@ -129,7 +129,7 @@ func (a *ArraySchema) AttributeNum() (uint, error) {
129129
var attrNum C.uint32_t
130130
ret := C.tiledb_array_schema_get_attribute_num(a.context.tiledbContext, a.tiledbArraySchema, &attrNum)
131131
if ret != C.TILEDB_OK {
132-
return 0, fmt.Errorf("Error getting attribute number for tiledb arraySchema: %s", a.context.LastError())
132+
return 0, fmt.Errorf("error getting attribute number for tiledb arraySchema: %w", a.context.LastError())
133133
}
134134
return uint(attrNum), nil
135135
}
@@ -143,7 +143,7 @@ func (a *ArraySchema) AttributeFromIndex(index uint) (*Attribute, error) {
143143
C.uint32_t(index),
144144
&attr.tiledbAttribute)
145145
if ret != C.TILEDB_OK {
146-
return nil, fmt.Errorf("Error getting attribute %d for tiledb arraySchema: %s", index, a.context.LastError())
146+
return nil, fmt.Errorf("error getting attribute %d for tiledb arraySchema: %w", index, a.context.LastError())
147147
}
148148
freeOnGC(&attr)
149149
return &attr, nil
@@ -158,7 +158,7 @@ func (a *ArraySchema) AttributeFromName(attrName string) (*Attribute, error) {
158158
attr := Attribute{context: a.context}
159159
ret := C.tiledb_array_schema_get_attribute_from_name(a.context.tiledbContext, a.tiledbArraySchema, cAttrName, &attr.tiledbAttribute)
160160
if ret != C.TILEDB_OK {
161-
return nil, fmt.Errorf("Error getting attribute %s for tiledb arraySchema: %s", attrName, a.context.LastError())
161+
return nil, fmt.Errorf("error getting attribute %s for tiledb arraySchema: %w", attrName, a.context.LastError())
162162
}
163163
freeOnGC(&attr)
164164
return &attr, nil
@@ -171,7 +171,7 @@ func (a *ArraySchema) HasAttribute(attrName string) (bool, error) {
171171
defer C.free(unsafe.Pointer(cAttrName))
172172
ret := C.tiledb_array_schema_has_attribute(a.context.tiledbContext, a.tiledbArraySchema, cAttrName, &hasAttr)
173173
if ret != C.TILEDB_OK {
174-
return false, fmt.Errorf("Error finding attribute %s in schema: %s", attrName, a.context.LastError())
174+
return false, fmt.Errorf("error finding attribute %s in schema: %w", attrName, a.context.LastError())
175175
}
176176

177177
if hasAttr == 0 {
@@ -193,7 +193,7 @@ func (a *ArraySchema) SetAllowsDups(allowsDups bool) error {
193193
ret := C.tiledb_array_schema_set_allows_dups(a.context.tiledbContext, a.tiledbArraySchema, C.int32_t(allowsDupsInt))
194194

195195
if ret != C.TILEDB_OK {
196-
return fmt.Errorf("Error setting allows dups for schema: %s", a.context.LastError())
196+
return fmt.Errorf("error setting allows dups for schema: %w", a.context.LastError())
197197
}
198198

199199
return nil
@@ -205,7 +205,7 @@ func (a *ArraySchema) AllowsDups() (bool, error) {
205205
var allowsDups C.int32_t
206206
ret := C.tiledb_array_schema_get_allows_dups(a.context.tiledbContext, a.tiledbArraySchema, &allowsDups)
207207
if ret != C.TILEDB_OK {
208-
return false, fmt.Errorf("Error getting allows dups for schema: %s", a.context.LastError())
208+
return false, fmt.Errorf("error getting allows dups for schema: %w", a.context.LastError())
209209
}
210210

211211
if allowsDups == 0 {
@@ -221,13 +221,13 @@ func (a *ArraySchema) Attributes() ([]*Attribute, error) {
221221

222222
attrNum, err := a.AttributeNum()
223223
if err != nil {
224-
return nil, fmt.Errorf("Error getting AttributeNum: %s", err)
224+
return nil, fmt.Errorf("error getting AttributeNum: %w", err)
225225
}
226226

227227
for i := uint(0); i < attrNum; i++ {
228228
attribute, err := a.AttributeFromIndex(i)
229229
if err != nil {
230-
return nil, fmt.Errorf("Error getting Attribute: %s", err)
230+
return nil, fmt.Errorf("error getting Attribute: %w", err)
231231
}
232232
attributes = append(attributes, attribute)
233233
}
@@ -238,7 +238,7 @@ func (a *ArraySchema) Attributes() ([]*Attribute, error) {
238238
func (a *ArraySchema) SetDomain(domain *Domain) error {
239239
ret := C.tiledb_array_schema_set_domain(a.context.tiledbContext, a.tiledbArraySchema, domain.tiledbDomain)
240240
if ret != C.TILEDB_OK {
241-
return fmt.Errorf("Error setting domain for tiledb arraySchema: %s", a.context.LastError())
241+
return fmt.Errorf("error setting domain for tiledb arraySchema: %w", a.context.LastError())
242242
}
243243
return nil
244244
}
@@ -248,7 +248,7 @@ func (a *ArraySchema) Domain() (*Domain, error) {
248248
domain := Domain{context: a.context}
249249
ret := C.tiledb_array_schema_get_domain(a.context.tiledbContext, a.tiledbArraySchema, &domain.tiledbDomain)
250250
if ret != C.TILEDB_OK {
251-
return nil, fmt.Errorf("Error setting domain for tiledb arraySchema: %s", a.context.LastError())
251+
return nil, fmt.Errorf("error setting domain for tiledb arraySchema: %w", a.context.LastError())
252252
}
253253
freeOnGC(&domain)
254254
return &domain, nil
@@ -258,7 +258,7 @@ func (a *ArraySchema) Domain() (*Domain, error) {
258258
func (a *ArraySchema) SetCapacity(capacity uint64) error {
259259
ret := C.tiledb_array_schema_set_capacity(a.context.tiledbContext, a.tiledbArraySchema, C.uint64_t(capacity))
260260
if ret != C.TILEDB_OK {
261-
return fmt.Errorf("Error setting capacity for tiledb arraySchema: %s", a.context.LastError())
261+
return fmt.Errorf("error setting capacity for tiledb arraySchema: %w", a.context.LastError())
262262
}
263263
return nil
264264
}
@@ -268,7 +268,7 @@ func (a *ArraySchema) Capacity() (uint64, error) {
268268
var capacity C.uint64_t
269269
ret := C.tiledb_array_schema_get_capacity(a.context.tiledbContext, a.tiledbArraySchema, &capacity)
270270
if ret != C.TILEDB_OK {
271-
return 0, fmt.Errorf("Error getting capacity for tiledb arraySchema: %s", a.context.LastError())
271+
return 0, fmt.Errorf("error getting capacity for tiledb arraySchema: %w", a.context.LastError())
272272
}
273273
return uint64(capacity), nil
274274
}
@@ -277,7 +277,7 @@ func (a *ArraySchema) Capacity() (uint64, error) {
277277
func (a *ArraySchema) SetCellOrder(cellOrder Layout) error {
278278
ret := C.tiledb_array_schema_set_cell_order(a.context.tiledbContext, a.tiledbArraySchema, C.tiledb_layout_t(cellOrder))
279279
if ret != C.TILEDB_OK {
280-
return fmt.Errorf("Error setting cell order for tiledb arraySchema: %s", a.context.LastError())
280+
return fmt.Errorf("error setting cell order for tiledb arraySchema: %w", a.context.LastError())
281281
}
282282
return nil
283283
}
@@ -287,7 +287,7 @@ func (a *ArraySchema) CellOrder() (Layout, error) {
287287
var cellOrder C.tiledb_layout_t
288288
ret := C.tiledb_array_schema_get_cell_order(a.context.tiledbContext, a.tiledbArraySchema, &cellOrder)
289289
if ret != C.TILEDB_OK {
290-
return -1, fmt.Errorf("Error getting cell order for tiledb arraySchema: %s", a.context.LastError())
290+
return -1, fmt.Errorf("error getting cell order for tiledb arraySchema: %w", a.context.LastError())
291291
}
292292
return Layout(cellOrder), nil
293293
}
@@ -296,7 +296,7 @@ func (a *ArraySchema) CellOrder() (Layout, error) {
296296
func (a *ArraySchema) SetTileOrder(tileOrder Layout) error {
297297
ret := C.tiledb_array_schema_set_tile_order(a.context.tiledbContext, a.tiledbArraySchema, C.tiledb_layout_t(tileOrder))
298298
if ret != C.TILEDB_OK {
299-
return fmt.Errorf("Error setting cell order for tiledb arraySchema: %s", a.context.LastError())
299+
return fmt.Errorf("error setting cell order for tiledb arraySchema: %w", a.context.LastError())
300300
}
301301
return nil
302302
}
@@ -306,7 +306,7 @@ func (a *ArraySchema) TileOrder() (Layout, error) {
306306
var cellOrder C.tiledb_layout_t
307307
ret := C.tiledb_array_schema_get_tile_order(a.context.tiledbContext, a.tiledbArraySchema, &cellOrder)
308308
if ret != C.TILEDB_OK {
309-
return -1, fmt.Errorf("Error getting cell order for tiledb arraySchema: %s", a.context.LastError())
309+
return -1, fmt.Errorf("error getting cell order for tiledb arraySchema: %w", a.context.LastError())
310310
}
311311
return Layout(cellOrder), nil
312312
}
@@ -315,7 +315,7 @@ func (a *ArraySchema) TileOrder() (Layout, error) {
315315
func (a *ArraySchema) SetCoordsFilterList(filterList *FilterList) error {
316316
ret := C.tiledb_array_schema_set_coords_filter_list(a.context.tiledbContext, a.tiledbArraySchema, filterList.tiledbFilterList)
317317
if ret != C.TILEDB_OK {
318-
return fmt.Errorf("Error setting coordinates filter list for tiledb arraySchema: %s", a.context.LastError())
318+
return fmt.Errorf("error setting coordinates filter list for tiledb arraySchema: %w", a.context.LastError())
319319
}
320320
return nil
321321
}
@@ -325,7 +325,7 @@ func (a *ArraySchema) CoordsFilterList() (*FilterList, error) {
325325
filterList := FilterList{context: a.context}
326326
ret := C.tiledb_array_schema_get_coords_filter_list(a.context.tiledbContext, a.tiledbArraySchema, &filterList.tiledbFilterList)
327327
if ret != C.TILEDB_OK {
328-
return nil, fmt.Errorf("Error getting coordinates filter list for tiledb arraySchema: %s", a.context.LastError())
328+
return nil, fmt.Errorf("error getting coordinates filter list for tiledb arraySchema: %w", a.context.LastError())
329329
}
330330
freeOnGC(&filterList)
331331
return &filterList, nil
@@ -336,7 +336,7 @@ func (a *ArraySchema) CoordsFilterList() (*FilterList, error) {
336336
func (a *ArraySchema) SetOffsetsFilterList(filterList *FilterList) error {
337337
ret := C.tiledb_array_schema_set_offsets_filter_list(a.context.tiledbContext, a.tiledbArraySchema, filterList.tiledbFilterList)
338338
if ret != C.TILEDB_OK {
339-
return fmt.Errorf("Error setting offsets filter list for tiledb arraySchema: %s", a.context.LastError())
339+
return fmt.Errorf("error setting offsets filter list for tiledb arraySchema: %w", a.context.LastError())
340340
}
341341
return nil
342342
}
@@ -347,7 +347,7 @@ func (a *ArraySchema) OffsetsFilterList() (*FilterList, error) {
347347
filterList := FilterList{context: a.context}
348348
ret := C.tiledb_array_schema_get_offsets_filter_list(a.context.tiledbContext, a.tiledbArraySchema, &filterList.tiledbFilterList)
349349
if ret != C.TILEDB_OK {
350-
return nil, fmt.Errorf("Error getting offsets filter list for tiledb arraySchema: %s", a.context.LastError())
350+
return nil, fmt.Errorf("error getting offsets filter list for tiledb arraySchema: %w", a.context.LastError())
351351
}
352352
freeOnGC(&filterList)
353353
return &filterList, nil
@@ -357,7 +357,7 @@ func (a *ArraySchema) OffsetsFilterList() (*FilterList, error) {
357357
func (a *ArraySchema) Check() error {
358358
ret := C.tiledb_array_schema_check(a.context.tiledbContext, a.tiledbArraySchema)
359359
if ret != C.TILEDB_OK {
360-
return fmt.Errorf("Error in checking arraySchema: %s", a.context.LastError())
360+
return fmt.Errorf("error in checking arraySchema: %w", a.context.LastError())
361361
}
362362
return nil
363363
}
@@ -369,7 +369,7 @@ func LoadArraySchema(context *Context, path string) (*ArraySchema, error) {
369369
a := ArraySchema{context: context}
370370
ret := C.tiledb_array_schema_load(a.context.tiledbContext, cpath, &a.tiledbArraySchema)
371371
if ret != C.TILEDB_OK {
372-
return nil, fmt.Errorf("Error in loading arraySchema from %s: %s", path, a.context.LastError())
372+
return nil, fmt.Errorf("error in loading arraySchema from %s: %w", path, a.context.LastError())
373373
}
374374
freeOnGC(&a)
375375
return &a, nil
@@ -379,7 +379,7 @@ func LoadArraySchema(context *Context, path string) (*ArraySchema, error) {
379379
func (a *ArraySchema) DumpSTDOUT() error {
380380
ret := C.tiledb_array_schema_dump(a.context.tiledbContext, a.tiledbArraySchema, C.stdout)
381381
if ret != C.TILEDB_OK {
382-
return fmt.Errorf("Error dumping array schema to stdout: %s", a.context.LastError())
382+
return fmt.Errorf("error dumping array schema to stdout: %w", a.context.LastError())
383383
}
384384
return nil
385385
}
@@ -388,7 +388,7 @@ func (a *ArraySchema) DumpSTDOUT() error {
388388
func (a *ArraySchema) Dump(path string) error {
389389

390390
if _, err := os.Stat(path); err == nil {
391-
return fmt.Errorf("Error path already %s exists", path)
391+
return fmt.Errorf("error path already %s exists", path)
392392
}
393393

394394
// Convert to char *
@@ -406,7 +406,7 @@ func (a *ArraySchema) Dump(path string) error {
406406
// Dump array schema to file
407407
ret := C.tiledb_array_schema_dump(a.context.tiledbContext, a.tiledbArraySchema, cFile)
408408
if ret != C.TILEDB_OK {
409-
return fmt.Errorf("Error dumping array schema to file %s: %s", path, a.context.LastError())
409+
return fmt.Errorf("error dumping array schema to file %s: %w", path, a.context.LastError())
410410
}
411411
return nil
412412
}
@@ -416,7 +416,7 @@ func (a *ArraySchema) Type() (ArrayType, error) {
416416
var arrayType C.tiledb_array_type_t
417417
ret := C.tiledb_array_schema_get_array_type(a.context.tiledbContext, a.tiledbArraySchema, &arrayType)
418418
if ret != C.TILEDB_OK {
419-
return TILEDB_DENSE, fmt.Errorf("Error fetching array schema type: %s", a.context.LastError())
419+
return TILEDB_DENSE, fmt.Errorf("error fetching array schema type: %w", a.context.LastError())
420420
}
421421

422422
return ArrayType(arrayType), nil

array_schema_evolution_experimental.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func NewArraySchemaEvolution(tdbCtx *Context) (*ArraySchemaEvolution, error) {
2424
arraySchemaEvolution.context.tiledbContext,
2525
&arraySchemaEvolution.tiledbArraySchemaEvolution)
2626
if ret != C.TILEDB_OK {
27-
return nil, fmt.Errorf("error creating tiledb arraySchemaEvolution: %s",
27+
return nil, fmt.Errorf("error creating tiledb arraySchemaEvolution: %w",
2828
arraySchemaEvolution.context.LastError())
2929
}
3030
freeOnGC(&arraySchemaEvolution)
@@ -60,7 +60,7 @@ func (ase *ArraySchemaEvolution) AddAttribute(attribute *Attribute) error {
6060
attribute.tiledbAttribute)
6161
if ret != C.TILEDB_OK {
6262
return fmt.Errorf(
63-
"error adding attribute %s to tiledb arraySchemaEvolution: %s",
63+
"error adding attribute %s to tiledb arraySchemaEvolution: %w",
6464
name, ase.context.LastError())
6565
}
6666

@@ -75,7 +75,7 @@ func (ase *ArraySchemaEvolution) DropAttribute(name string) error {
7575
ret := C.tiledb_array_schema_evolution_drop_attribute(
7676
ase.context.tiledbContext, ase.tiledbArraySchemaEvolution, cname)
7777
if ret != C.TILEDB_OK {
78-
return fmt.Errorf("error dropping tiledb attribute: %s",
78+
return fmt.Errorf("error dropping tiledb attribute: %w",
7979
ase.context.LastError())
8080
}
8181

@@ -90,7 +90,7 @@ func (ase *ArraySchemaEvolution) Evolve(uri string) error {
9090
ret := C.tiledb_array_evolve(ase.context.tiledbContext, curi,
9191
ase.tiledbArraySchemaEvolution)
9292
if ret != C.TILEDB_OK {
93-
return fmt.Errorf("error evolving schema for array %s: %s", uri,
93+
return fmt.Errorf("error evolving schema for array %s: %w", uri,
9494
ase.context.LastError())
9595
}
9696

0 commit comments

Comments
 (0)