what you did is correct. it can be explained as follows:

1) the value of z completely depends on the value of x+y.

2)the lower the value of x+y the lower the value of z.

3) the least value of x+y available in D is 0.

so e^0-2 is the answer.

Here the situation was fairly simple so we could use the above reasoning. In general such problems are solved using multivariate calculus.