Skip to content

Commit b1fbc37

Browse files
committed
[std] more information about catching errors
1 parent aef8f2c commit b1fbc37

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

std/haxe/macro/CompilationServer.hx

+3-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ class CompilationServer {
7272
/**
7373
Invalidates a module, removing it from the cache.
7474
75-
If the module has already been loaded in current context, a compiler
76-
error will be raised which can be caught using `try ... catch`.
75+
If the module has already been loaded in current context, a
76+
`haxe.macro.Expr.Error` compiler error will be raised which can be
77+
caught using `try ... catch`.
7778
**/
7879
static public function invalidateModule(path:String) {
7980
@:privateAccess Compiler.load("server_invalidate_module", 1)(path);

std/haxe/macro/Context.hx

+8
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,10 @@ class Context {
663663
/**
664664
Defines a new type from `TypeDefinition` `t`.
665665
666+
If a matching module has already been loaded in current context, a
667+
`haxe.macro.Expr.Error` compiler error will be raised which can be
668+
caught using `try ... catch`.
669+
666670
If `moduleDependency` is given and is not `null`, it should contain
667671
a module path that will be used as a dependency for the newly defined module
668672
instead of the current module.
@@ -695,6 +699,10 @@ class Context {
695699
Defines a new module as `modulePath` with several `TypeDefinition`
696700
`types`. This is analogous to defining a .hx file.
697701
702+
If a matching module has already been loaded in current context, a
703+
`haxe.macro.Expr.Error` compiler error will be raised which can be
704+
caught using `try ... catch`.
705+
698706
The individual `types` can reference each other and any identifier
699707
respects the `imports` and `usings` as usual, expect that imports are
700708
not allowed to have `.*` wildcards or `as s` shorthands.

0 commit comments

Comments
 (0)