Software /
code /
prosody
Comparison
core/portmanager.lua @ 13252:84c7779618b6
core.portmanager: Join strings broken into multiple lines
Improves readability. Reduces line count. What's not to like?
The code style and luacheck rules allows longer lines, and these strings
aren't long enough to need breaking into multiple lines like this.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 29 Jul 2023 02:04:24 +0200 |
parent | 13251:7748dfb201de |
comparison
equal
deleted
inserted
replaced
13251:7748dfb201de | 13252:84c7779618b6 |
---|---|
46 local function error_to_friendly_message(service_name, port, err) --luacheck: ignore 212/service_name | 46 local function error_to_friendly_message(service_name, port, err) --luacheck: ignore 212/service_name |
47 local friendly_message = err; | 47 local friendly_message = err; |
48 if err:match(" in use") then | 48 if err:match(" in use") then |
49 -- FIXME: Use service_name here | 49 -- FIXME: Use service_name here |
50 if port == 5222 or port == 5223 or port == 5269 then | 50 if port == 5222 or port == 5223 or port == 5269 then |
51 friendly_message = "check that Prosody or another XMPP server is " | 51 friendly_message = "check that Prosody or another XMPP server is not already running and using this port"; |
52 .."not already running and using this port"; | |
53 elseif port == 80 or port == 81 or port == 443 then | 52 elseif port == 80 or port == 81 or port == 443 then |
54 friendly_message = "check that a HTTP server is not already using " | 53 friendly_message = "check that a HTTP server is not already using this port"; |
55 .."this port"; | |
56 elseif port == 5280 then | 54 elseif port == 5280 then |
57 friendly_message = "check that Prosody or a BOSH connection manager " | 55 friendly_message = "check that Prosody or a BOSH connection manager is not already running"; |
58 .."is not already running"; | |
59 else | 56 else |
60 friendly_message = "this port is in use by another application"; | 57 friendly_message = "this port is in use by another application"; |
61 end | 58 end |
62 elseif err:match("permission") then | 59 elseif err:match("permission") then |
63 friendly_message = "Prosody does not have sufficient privileges to use this port"; | 60 friendly_message = "Prosody does not have sufficient privileges to use this port"; |