Differences

This shows you the differences between two versions of the page.

Link to this comparison view

irc:1493589600 [2017/05/27 13:44] (current)
Line 1: Line 1:
 +[22:10:20] <​cazacugmihai>​ Hi! Is it necessarily to call RoutingContext.next() after RoutingContext.fail() as I see at https://​github.com/​vert-x3/​vertx-web/​blob/​3040d1b97457991eb4eded94de16de2ac0732e14/​vertx-web/​src/​main/​java/​io/​vertx/​ext/​web/​handler/​impl/​SessionHandlerImpl.java#​L125?​ From what I see, "​fail"​ already calls "​next"​ method.
 +
 +[22:11:15] <​xkr47>​ cazacugmihai,​ afaik you call either fail or next
 +
 +[22:11:50] <​cazacugmihai>​ yes, but in that code both methods are called, each after the other
 +
 +[22:13:28] <​cazacugmihai>​ *one after the other
 +
 +[22:15:55] <​xkr47>​ let me see
 +
 +[22:16:05] <​xkr47>​ I'm just a user, but hey
 +
 +[22:18:33] <​xkr47>​ ah yes
 +
 +[22:18:43] <​xkr47>​ you were checking the doFail() method right ?
 +
 +[22:20:37] <​xkr47>​ assuming yes; before calling next() it resets the list of handlers to walk through to the beginning, so it starts iterating all handlers again
 +
 +[22:21:21] <​xkr47>​ but then next() is implemented (through iterateNext()) so that if a failure was encountered,​ it only iterates failure handlers instead of only non-failure handlers which it normally does
 +
 +[22:21:42] <​xkr47>​ so the end result is different even though it internally calls next()
 +
 +[22:21:52] <​xkr47>​ because it changes the internal state first
 +
 +[23:18:57] <​cazacugmihai>​ xkr47: Yes, you have right! Thanks for the explanation! :)