diff options
| author | Jim Lawson | 2018-02-16 17:10:30 -0800 |
|---|---|---|
| committer | GitHub | 2018-02-16 17:10:30 -0800 |
| commit | edcb81a34dbf8a04d0b011aa1ca07c6e19598f23 (patch) | |
| tree | aba2e3b8b921f9fdc861ed51687735f6d18d7bff /src/main/scala/firrtl/passes/memlib | |
| parent | 74a3b302df4422bec47e754cad1703b36ff75cd2 (diff) | |
Replacematcherror - catch exceptions and convert to internal error. (#424)
* Catch exceptions and convert to internal error.
We need to update the displayed message to incorporate a line number and text to be used for the issue.
* Cleanup exception handling/throwing.
Re-throw expected (or uncorrectable exceptions).
Provide Utils.getThrowable() to get the first (eldest) or last throwable in the chain.
Update tests to conform to FreeSpec protocol.
* Minor cleanup
Admit we've updated some deprecated ScalaTest methods.
Diffstat (limited to 'src/main/scala/firrtl/passes/memlib')
| -rw-r--r-- | src/main/scala/firrtl/passes/memlib/ReplaceMemMacros.scala | 2 | ||||
| -rw-r--r-- | src/main/scala/firrtl/passes/memlib/YamlUtils.scala | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/scala/firrtl/passes/memlib/ReplaceMemMacros.scala b/src/main/scala/firrtl/passes/memlib/ReplaceMemMacros.scala index b18ed289..bf0612ac 100644 --- a/src/main/scala/firrtl/passes/memlib/ReplaceMemMacros.scala +++ b/src/main/scala/firrtl/passes/memlib/ReplaceMemMacros.scala @@ -224,7 +224,7 @@ class ReplaceMemMacros(writer: ConfWriter) extends Transform { val pins = getMyAnnotations(state) match { case Nil => Nil case Seq(PinAnnotation(CircuitName(c), pins)) => pins - case _ => throwInternalError + case _ => throwInternalError(Some(s"execute: getMyAnnotations - ${getMyAnnotations(state)}")) } val annos = (pins.foldLeft(Seq[Annotation]()) { (seq, pin) => seq ++ memMods.collect { diff --git a/src/main/scala/firrtl/passes/memlib/YamlUtils.scala b/src/main/scala/firrtl/passes/memlib/YamlUtils.scala index 4cc28e42..3e0c6a44 100644 --- a/src/main/scala/firrtl/passes/memlib/YamlUtils.scala +++ b/src/main/scala/firrtl/passes/memlib/YamlUtils.scala @@ -31,7 +31,7 @@ class YamlFileReader(file: String) { catch { case e: Exception => None } ) } - else error("Yaml file doesn't exist!") + else sys.error("Yaml file doesn't exist!") } } |
