Skip to content

cjson.decode should be wrapped in a pcall #9

Open
@ddragosd

Description

@ddragosd

This is where the error occurs.

val = cjson.decode(val_string)

It seems to be an edge case and we need to add a try/catch for this scenario. I’m assuming this is happening when a rule expires and we have an incoming request in that millisecond and the shared dictionary returns an empty string for a rule causing the cjson lib to complain ?... one possiblity

We should wrap the decode into a pcall as follows:

local ok, val = pcall(cjson.decode,val_string)
if not ok then
   -- continue
end

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions