~reesmichael1/roman

ccf1acaf15a79e042b654eba92dfb6018732441b — Michael Rees 8 months ago 9dc07eb
Clean up some redundant exception handling
2 files changed, 4 insertions(+), 8 deletions(-)

M src/romanpkg/main.nim
M src/romanpkg/paths.nim
M src/romanpkg/main.nim => src/romanpkg/main.nim +2 -4
@@ 25,10 25,8 @@ proc chooseFeed(feeds: seq[Feed]): Feed {.raises: [RomanError,
      raise newException(InterruptError, "no feed selected")
    let name = selectedName.unsafeGet()
    result = filter(feeds, proc(f: Feed): bool = f.title == name)[0]
  except ValueError as e:
    raise newException(RomanError, e.msg)
  except IOError as e:
    raise newException(RomanError, e.msg)
  except ValueError, IOError:
    raise newException(RomanError, getCurrentExceptionMsg())


proc runMainPath() {.raises: [RomanError, InterruptError].} =

M src/romanpkg/paths.nim => src/romanpkg/paths.nim +2 -4
@@ 19,10 19,8 @@ proc initConfigDir*() {.raises: [RomanError].} =
      let subs = getSubsFilePath()
      writeFile(config, "")
      writeFile(subs, "")
  except OSError as e:
    raise newException(RomanError, e.msg)
  except IOError as e:
    raise newException(RomanError, e.msg)
  except IOError, OSError:
    raise newException(RomanError, getCurrentExceptionMsg())


proc getShareDir*(): string {.raises: [].} =