{"action":"created","issue":{"url":"https://api.github.com/repos/gap-system/gap/issues/354","labels_url":"https://api.github.com/repos/gap-system/gap/issues/354/labels{/name}","comments_url":"https://api.github.com/repos/gap-system/gap/issues/354/comments","events_url":"https://api.github.com/repos/gap-system/gap/issues/354/events","html_url":"https://github.com/gap-system/gap/issues/354","id":116847836,"number":354,"title":"Error message while trying to read non-existing file","user":{"login":"alex-konovalov","id":5751387,"avatar_url":"https://avatars.githubusercontent.com/u/5751387?v=3","gravatar_id":"","url":"https://api.github.com/users/alex-konovalov","html_url":"https://github.com/alex-konovalov","followers_url":"https://api.github.com/users/alex-konovalov/followers","following_url":"https://api.github.com/users/alex-konovalov/following{/other_user}","gists_url":"https://api.github.com/users/alex-konovalov/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-konovalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-konovalov/subscriptions","organizations_url":"https://api.github.com/users/alex-konovalov/orgs","repos_url":"https://api.github.com/users/alex-konovalov/repos","events_url":"https://api.github.com/users/alex-konovalov/events{/privacy}","received_events_url":"https://api.github.com/users/alex-konovalov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-13T20:41:11Z","updated_at":"2015-11-14T15:33:12Z","closed_at":null,"body":"@cdwensley suggested that the following error message is not very helpful - one would expect a \"file does not exist\" - in the following attempt:\r\n```\r\ngap> Read(Filename(DirectoriesLibrary(\"tst\"),\"testall.g\"));\r\nError, no method found! For debugging hints type ?Recovery from NoMethodFound\r\nError, no 1st choice method found for `Read' on 1 arguments called from\r\n<function \"HANDLE_METHOD_NOT_FOUND\">( <arguments> )\r\ncalled from read-eval loop at line 1 of *stdin*\r\nyou can 'quit;' to quit to outer loop, or\r\nyou can 'return;' to continue\r\n```\r\nOf course (this is in GAP 4.8.0), `Filename` returned `fail` because `testall.g` is now `teststandard.g`. We can't detect this in `Read` since it is an operation declared for strings, and installed for streams via `InstallOtherMethod`. We need either to declare it for IsObject to catch `fail`, or install other method for booleans, like e.g. this:\r\n\r\n```\r\nInstallOtherMethod( Read, \"to produce meaningful error message\",\r\n[ IsBool ],\r\nfunction( x )\r\nif x = fail then\r\n    Error(\"Calling Read(fail) is not possible. Please check that the file exists\");\r\nelse\r\n    Error(\"The argument of 'Read' should be a stream, or a string with the name of the existing file\");\r\nfi;\r\nend);\r\n```\r\n\r\nDoes it make sense to add such other method?\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/gap-system/gap/issues/comments/156712474","html_url":"https://github.com/gap-system/gap/issues/354#issuecomment-156712474","issue_url":"https://api.github.com/repos/gap-system/gap/issues/354","id":156712474,"user":{"login":"alex-konovalov","id":5751387,"avatar_url":"https://avatars.githubusercontent.com/u/5751387?v=3","gravatar_id":"","url":"https://api.github.com/users/alex-konovalov","html_url":"https://github.com/alex-konovalov","followers_url":"https://api.github.com/users/alex-konovalov/followers","following_url":"https://api.github.com/users/alex-konovalov/following{/other_user}","gists_url":"https://api.github.com/users/alex-konovalov/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-konovalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-konovalov/subscriptions","organizations_url":"https://api.github.com/users/alex-konovalov/orgs","repos_url":"https://api.github.com/users/alex-konovalov/repos","events_url":"https://api.github.com/users/alex-konovalov/events{/privacy}","received_events_url":"https://api.github.com/users/alex-konovalov/received_events","type":"User","site_admin":false},"created_at":"2015-11-14T15:33:12Z","updated_at":"2015-11-14T15:33:12Z","body":"Ah, that makes things better.  Such change may help for no-method-found errors to cause less confusion and take less time to understand. In theory, for any object there a fallback method should print `<object>` in case no specific methods are installed, so this will not cause another no-method-found-error. Can we look at your patch?"}}