// Code derived from Stroustrup's PPP2 book// § 5.5.2 The callee deals with errors// -and beginning on p 143#include<iostream>#include<stdexcept>usingstd::cout;usingstd::runtime_error;// error() simply disguises throwsvoiderror(constchar*s){throwruntime_error(s);}// calculate area of a rectangleintarea(intlength,intwidth){if(length<=0||width<=0)error("non-positive area() argument");returnlength*width;}// calculate area within frameintframed_area(intx,inty){constexprintframe_width=2;if(x-frame_width<=0||y-frame_width<=0)error("non-positive area() argument called by framed_area()");returnarea(x-frame_width,y-frame_width);}intmain(){inty=0;// please test out some positive values here, toointz=0;//intarea2=framed_area(1,z);intarea3=framed_area(y,z);cout<<y<<'\n'//<<z<<'\n'//<<area2<<'\n'//<<area3<<'\n';}