Something's fishy here.

<% if (typeof error!== 'undefined') { %> <%= error %> <% } else { %> The page you were trying to reach doesn't exist. <% } %>

Why might this be happening?