This commit is contained in:
Yuichi Nishiwaki 2015-06-24 02:17:13 +09:00
parent f5789c7c6f
commit 0daa4febb0
1 changed files with 2 additions and 1 deletions

View File

@ -108,7 +108,8 @@ pic_open_file(pic_state *pic, const char *name, int flags) {
mode = 'w';
}
if ((file = file_open(pic, name, &mode)) == NULL) {
pic_errorf(pic, "could not open file '%s'", name);
pic_str *msg = pic_format(pic, "could not open file '%s'", name);
pic_raise(pic, pic_obj_value(pic_make_error(pic, pic->sFILE, pic_str_cstr(pic, msg), pic_nil_value())));
}
port = (struct pic_port *)pic_obj_alloc(pic, sizeof(struct pic_port), PIC_TT_PORT);