scala - Wiring a Play Filter to wrap the error handler -


i have play filter post request logging this:

class loggingfilter extends filter lazylogging {   override def apply(f: (requestheader) => future[result])(rh: requestheader): future[result] =     f(rh) andthen {       case success(result) =>         logger.info(s"[success] ${result.header.status}")       case failure(e) =>         val end = system.currenttimemillis()         val duration = end - start         logger.error(s"[failure] ${e.getmessage}}", e)     }   } } 

i have onservererror handler maps known exceptions appropriate result. unfortunately, filter invoked before error handler converts known exceptions results, leaving me without status code sent caller , stack trace handled exception in logs.

is there way define filter wraps request post errors handler invocation?


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -