Commit 70915934 authored by Ilya Prokhorov's avatar Ilya Prokhorov

Show outside bounds error correctly

parent 03a7e3ed
......@@ -16,7 +16,11 @@ Image::Image(int width, int height) {
void Image::setColorAtXY(shared_ptr<Color> color, int x, int y) {
if (x < 0 || y < 0 || x >= width || y >= height) {
throwRuntimeException("Can't set color outside of image size");
string errorString = string("Can't set color outside of image size");
errorString += to_string(x);
errorString += " ";
errorString += to_string(y);
throwRuntimeException(errorString);
}
int index = (y * width) + x;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment