Software /
code /
prosody
Changeset
10015:8297408db58b 0.11
util.random: Coerce error to string (thanks waqas)
In theory this could happen in an EOF condition, which should be
impossible with a read from /dev/urandom.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 18 May 2019 18:51:25 +0200 |
parents | 10014:5d2f7144fa12 |
children | 10016:af8c514e5cf7 |
files | util/random.lua |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/util/random.lua Sat May 18 17:28:21 2019 +0200 +++ b/util/random.lua Sat May 18 18:51:25 2019 +0200 @@ -14,7 +14,7 @@ local function bytes(n) local data, err = urandom:read(n); if not data then - error("Unable to retrieve data from secure random number generator (/dev/urandom): "..err); + error("Unable to retrieve data from secure random number generator (/dev/urandom): "..tostring(err)); end return data; end