Skip to content

Commit

Permalink
Unify error names
Browse files Browse the repository at this point in the history
We use `errors.new_class()` that declares error names. Error names
usually has a form "<OperationName>Error", but some error codes has a form
"<OperationName>". This patch makes all error names conform to the first
form.
  • Loading branch information
ligurio committed Jul 27, 2021
1 parent e76f96a commit ea7560d
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Changed

* Names of errors generated by CRUD operations have been unified.

### Added

* `crud.len()` function to calculate the number of tuples
Expand Down
2 changes: 1 addition & 1 deletion crud/borders.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local schema = require('crud.common.schema')
local has_keydef, Keydef = pcall(require, 'crud.compare.keydef')
local select_comparators = require('crud.compare.comparators')

local BorderError = errors.new_class('Border', {capture_stack = false})
local BorderError = errors.new_class('BorderError', {capture_stack = false})

local borders = {}

Expand Down
2 changes: 1 addition & 1 deletion crud/common/call.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local dev_checks = require('crud.common.dev_checks')
local utils = require('crud.common.utils')
local fiber_clock = require('fiber').clock

local CallError = errors.new_class('Call')
local CallError = errors.new_class('CallError')
local NotInitializedError = errors.new_class('NotInitialized')

local call = {}
Expand Down
2 changes: 1 addition & 1 deletion crud/delete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local sharding = require('crud.common.sharding')
local dev_checks = require('crud.common.dev_checks')
local schema = require('crud.common.schema')

local DeleteError = errors.new_class('Delete', {capture_stack = false})
local DeleteError = errors.new_class('DeleteError', {capture_stack = false})

local delete = {}

Expand Down
2 changes: 1 addition & 1 deletion crud/get.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local sharding = require('crud.common.sharding')
local dev_checks = require('crud.common.dev_checks')
local schema = require('crud.common.schema')

local GetError = errors.new_class('Get', {capture_stack = false})
local GetError = errors.new_class('GetError', {capture_stack = false})

local get = {}

Expand Down
2 changes: 1 addition & 1 deletion crud/insert.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local sharding = require('crud.common.sharding')
local dev_checks = require('crud.common.dev_checks')
local schema = require('crud.common.schema')

local InsertError = errors.new_class('Insert', {capture_stack = false})
local InsertError = errors.new_class('InsertError', {capture_stack = false})

local insert = {}

Expand Down
2 changes: 1 addition & 1 deletion crud/replace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local sharding = require('crud.common.sharding')
local dev_checks = require('crud.common.dev_checks')
local schema = require('crud.common.schema')

local ReplaceError = errors.new_class('Replace', { capture_stack = false })
local ReplaceError = errors.new_class('ReplaceError', { capture_stack = false })

local replace = {}

Expand Down
2 changes: 1 addition & 1 deletion crud/truncate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local vshard = require('vshard')
local dev_checks = require('crud.common.dev_checks')
local call = require('crud.common.call')

local TruncateError = errors.new_class('Truncate', {capture_stack = false})
local TruncateError = errors.new_class('TruncateError', {capture_stack = false})

local truncate = {}

Expand Down
2 changes: 1 addition & 1 deletion crud/update.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local sharding = require('crud.common.sharding')
local dev_checks = require('crud.common.dev_checks')
local schema = require('crud.common.schema')

local UpdateError = errors.new_class('Update', {capture_stack = false})
local UpdateError = errors.new_class('UpdateError', {capture_stack = false})

local update = {}

Expand Down

0 comments on commit ea7560d

Please sign in to comment.