File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 102102 return TargetObject
103103 }
104104
105- /**** throwError - simplifies construction of named errors ****/
105+ /**** throwableError - simplifies construction of named errors ****/
106106
107- export function throwError ( Message :string ) :never {
107+ export function throwableError ( Message :string ) :Error {
108108 let Match = / ^ ( [ $ a - z A - Z ] [ $ a - z A - Z 0 - 9 ] * ) : \s * ( \S .+ ) \s * $ / . exec ( Message )
109109 if ( Match == null ) {
110- throw new Error ( Message )
110+ return new Error ( Message )
111111 } else {
112112 let namedError = new Error ( Match [ 2 ] )
113113 namedError . name = Match [ 1 ]
114- throw namedError
114+ return namedError
115115 }
116116 }
117117
118+ /**** throwError - throws a named error ****/
119+
120+ export function throwError ( Message :string ) :never {
121+ throw throwableError ( Message )
122+ }
123+
118124//------------------------------------------------------------------------------
119125//-- Value Classification Functions --
120126//------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments