MCPcopy Create free account
hub / github.com/BaseXdb/basex / run

Method run

basex-api/src/main/java/org/basex/http/ws/WebSocket.java:196–206  ·  view source on GitHub ↗

Runs a function and creates log output. @param info log string @param status close status (can be null) @param func function to be run

(final String info, final Integer status, final Runnable func)

Source from the content-addressed store, hash-verified

194 * @param func function to be run
195 */
196 private void run(final String info, final Integer status, final Runnable func) {
197 context.log.write(LogType.REQUEST, info, null, context);
198 final Performance perf = new Performance();
199 try {
200 func.run();
201 } catch(final Exception ex) {
202 context.log.write(LogType.ERROR, "", perf, context);
203 throw ex;
204 }
205 context.log.write(status != null ? status : LogType.OK, null, perf, context);
206 }
207}

Callers 3

onWebSocketConnectMethod · 0.95
onWebSocketErrorMethod · 0.95
onWebSocketCloseMethod · 0.95

Calls 2

runMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected