Is surprise used to mean the same thing in the next two sentences?

The surprise attack was devastating.

Imagine my surprise on learning I owed twice as much as I thought I did.
different meanings