[Tarantool-patches] [PATCH resend v2 09/11] lua, datetime: time intervals support

Oleg Babin olegrok at tarantool.org
Sat Jul 31 09:31:22 MSK 2021


On 31.07.2021 01:58, Timur Safin wrote:
> :
> : tarantool> return require('datetime').now() + 1
> : ---
> : - error: '[string "return require(''datetime'').now() + 1"]:1: Usage:
> : datetime:__add(interval)'
> : ...
> :
> :
> : Looks a bit confusing. User doesn't know about metamethods.
>
> Partially agreed. Though I assume that users of this code will
> be educated enough. But in any case, what would be your suggested
> error message here?
>
In fact I don't know exactly.

But decimal shows something like:

```

tarantool> decimal.new(1) + 'abc'
---
- error: '[string "return decimal.new(1) + ''abc''"]:1: incorrect value 
to convert
     to decimal as 2 argument'
...

```



More information about the Tarantool-patches mailing list