Fix modal behavior upon HTTP error

Bug: 1144203
Change-Id: I1425f0ed7ece2fbb86dcab60a58259af4b331058