{"action":"created","issue":{"url":"https://api.github.com/repos/SFML-haskell/SFML/issues/15","labels_url":"https://api.github.com/repos/SFML-haskell/SFML/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/SFML-haskell/SFML/issues/15/comments","events_url":"https://api.github.com/repos/SFML-haskell/SFML/issues/15/events","html_url":"https://github.com/SFML-haskell/SFML/issues/15","id":108108626,"number":15,"title":"Merge exception types","user":{"login":"jeannekamikaze","id":1595451,"avatar_url":"https://avatars.githubusercontent.com/u/1595451?v=3","gravatar_id":"","url":"https://api.github.com/users/jeannekamikaze","html_url":"https://github.com/jeannekamikaze","followers_url":"https://api.github.com/users/jeannekamikaze/followers","following_url":"https://api.github.com/users/jeannekamikaze/following{/other_user}","gists_url":"https://api.github.com/users/jeannekamikaze/gists{/gist_id}","starred_url":"https://api.github.com/users/jeannekamikaze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeannekamikaze/subscriptions","organizations_url":"https://api.github.com/users/jeannekamikaze/orgs","repos_url":"https://api.github.com/users/jeannekamikaze/repos","events_url":"https://api.github.com/users/jeannekamikaze/events{/privacy}","received_events_url":"https://api.github.com/users/jeannekamikaze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-24T11:02:10Z","updated_at":"2015-09-27T11:44:50Z","closed_at":null,"body":"I would like to know what you think on this topic.\r\n\r\nCurrently we have an exception type for every module - MusicException, TextureException, FontException, RectangleShapeException, and the list goes on [1] - and all of them with an identical definition. This seems unnecessary and cumbersome; I can't even remember why we did it this way or if we ever discussed this at all. Do you think it would be sensible to merge all of those exceptions into a single data type, like SFException?\r\n\r\n[1] Full list of exceptions:\r\n\r\n```\r\n$ grep -R \"Exception =\" src/\r\nsrc/SFML/Audio/Music.hs:data MusicException = MusicException String deriving (Show, Typeable)\r\nsrc/SFML/Audio/SoundBuffer.hs:data SoundBufferException = SoundBufferException String deriving (Show, Typeable)\r\nsrc/SFML/Audio/SoundBufferRecorder.hs:data SoundBufferRecorderException = SoundBufferRecorderException String deriving (Show, Typeable)\r\nsrc/SFML/Audio/SoundRecorder.hs:data SoundRecorderException = SoundRecorderException String deriving (Show, Typeable)\r\nsrc/SFML/Graphics/CircleShape.hs:data CircleShapeException = CircleShapeException String deriving (Show, Typeable)\r\nsrc/SFML/Graphics/ConvexShape.hs:data ConvexShapeException = ConvexShapeException String deriving (Show, Typeable)\r\nsrc/SFML/Graphics/Font.hs:data FontException = FontException String deriving (Show, Typeable)\r\nsrc/SFML/Graphics/Image.hs:data ImageException = ImageException String deriving (Show, Typeable)\r\nsrc/SFML/Graphics/RectangleShape.hs:data RectangleShapeException = RectangleShapeException String deriving (Show, Typeable)\r\nsrc/SFML/Graphics/RenderTexture.hs:data RenderTextureException = RenderTextureException String deriving (Show, Typeable)\r\nsrc/SFML/Graphics/Shader.hs:data ShaderException = ShaderException String deriving (Show, Typeable)\r\nsrc/SFML/Graphics/Sprite.hs:data SpriteException = SpriteException String deriving (Show, Typeable)\r\nsrc/SFML/Graphics/Text.hs:data TextException = TextException String deriving (Show, Typeable)\r\nsrc/SFML/Graphics/Texture.hs:data TextureException = TextureException String deriving (Show, Typeable)\r\n```"},"comment":{"url":"https://api.github.com/repos/SFML-haskell/SFML/issues/comments/143544925","html_url":"https://github.com/SFML-haskell/SFML/issues/15#issuecomment-143544925","issue_url":"https://api.github.com/repos/SFML-haskell/SFML/issues/15","id":143544925,"user":{"login":"adinapoli","id":442035,"avatar_url":"https://avatars.githubusercontent.com/u/442035?v=3","gravatar_id":"","url":"https://api.github.com/users/adinapoli","html_url":"https://github.com/adinapoli","followers_url":"https://api.github.com/users/adinapoli/followers","following_url":"https://api.github.com/users/adinapoli/following{/other_user}","gists_url":"https://api.github.com/users/adinapoli/gists{/gist_id}","starred_url":"https://api.github.com/users/adinapoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adinapoli/subscriptions","organizations_url":"https://api.github.com/users/adinapoli/orgs","repos_url":"https://api.github.com/users/adinapoli/repos","events_url":"https://api.github.com/users/adinapoli/events{/privacy}","received_events_url":"https://api.github.com/users/adinapoli/received_events","type":"User","site_admin":false},"created_at":"2015-09-27T11:44:50Z","updated_at":"2015-09-27T11:44:50Z","body":"Hey @jeannekamikaze ,\r\n\r\nat glance it sounds good to me. I suspect you did this in the very beginning to keep a 1:1 spirit with SFML, but of course I cannot be sure not being physically present :wink: \r\n\r\nI do agree that the most Haskell-y way of going would be to merge all the exceptions as constructor of a single umbrella type `SFMLException`."}}