[ckan-dev] Questions about the IMiddleware interface

Mads R. Havmand mhv at energinet.dk
Wed Aug 8 17:07:54 UTC 2018


I'm looking at building and implementing an extension that logs requests, logs errors and catches uncaught exceptions and ships them to a 3rd party error analysis tool.

It seems that the IMiddleware interface would be an ideal solution for this. Implementing the make_middleware() method works for accessing the actual request, but I'm not sure what to do with make_error_log_middleware(). The documentation for this method is rather sparse and I'm not sure when this method is called, versus when make_middleware() is called.

I'm assuming that make_error_log_middleware() simple makes a piece of middleware that will handle errors ('Cause that's what the name says), but which errors and how can you access said error?

Could anybody shed some light on the difference between those two methods?
The documentation for the method is here: http://docs.ckan.org/en/latest/extensions/plugin-interfaces.html#ckan.plugins.interfaces.IMiddleware.make_error_log_middleware

Venlig hilsen

Mads R. Havmand
Softwareudvikler
IT Enterprise Information Mgmt.
+4561149549
mhv at energinet.dk<mailto:mhv at energinet.dk>

[Energinet.dk]
Energinet
Tonne Kjærsvej 65
DK-7000 Fredericia
+4570102244
www.energinet.dk

<https://energinet.dk/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20180808/f3b9a4b1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 2660 bytes
Desc: image001.jpg
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20180808/f3b9a4b1/attachment.jpg>


More information about the ckan-dev mailing list