<commit_before><?php

namespace Imagize;

use Imagize\Exceptions\ImageNotFoundException;
use Imagize\Exceptions\InvalidStringArgumentException;

class ImageFileLoader {

    private $path;

    public function __construct($path) {
        if (!is_string($path)) throw new InvalidStringArgumentException('path');
        $this->path = $path;
    }

    public function getImageFile($fileName) {

        if (!file_exists("$this->path/$fileName.png")) throw new ImageNotFoundException($fileName);

        return file_get_contents("$this->path/$fileName.png");

    }

}<commit_msg>better error message<commit_after><?php

namespace Imagize;

use Imagize\Exceptions\ImageNotFoundException;
use Imagize\Exceptions\InvalidStringArgumentException;

class ImageFileLoader {

    private $path;

    public function __construct($path) {
        if (!is_string($path)) throw new InvalidStringArgumentException('path');
        $this->path = $path;
    }

    public function getImageFile($fileName) {

        $path = "$this->path/$fileName.png";
        if (!file_exists($path)) throw new ImageNotFoundException($path);

        return file_get_contents($path);

    }

}
{'fraction_non_alphanumeric': 0.11941580756013746, 'fraction_numerical': 0.0, 'mean_word_length': 4.043290043290043, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3675810', 'n_tokens_mistral': 334, 'n_tokens_neox': 323, 'n_words': 66}