* Gets error message from error object * @param {Error} err * @param {...string} args
(err, ...args)
| 149 | * @param {...string} args |
| 150 | */ |
| 151 | errorMessage(err, ...args) { |
| 152 | args.forEach((arg, i) => { |
| 153 | if (/^(content|file|ftp|sftp|https?):/.test(arg)) { |
| 154 | args[i] = this.getVirtualPath(arg); |
| 155 | } |
| 156 | }); |
| 157 | |
| 158 | const extra = args.join("<br>"); |
| 159 | let msg; |
| 160 | |
| 161 | if (typeof err === "string" && err) { |
| 162 | msg = err; |
| 163 | } else if (err instanceof Error) { |
| 164 | msg = err.message; |
| 165 | } else { |
| 166 | msg = strings["an error occurred"]; |
| 167 | } |
| 168 | |
| 169 | return msg + (extra ? "<br>" + extra : ""); |
| 170 | }, |
| 171 | /** |
| 172 | * |
| 173 | * @param {Error} err |
nothing calls this directly
no outgoing calls
no test coverage detected