Skip to content

Commit

Permalink
add error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
vyudu committed Nov 21, 2024
1 parent 3b357c8 commit 1efb96a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/src/model_creation/dsl_advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,14 @@ In some cases it may be desirable for Catalyst to not infer species and paramete

```julia
using Catalyst
# The following case will throw an UndeclaredSymbolicError.
rn = @reaction_network begin
@require_declaration
(k1, k2), A <--> B
end
```
In order to avoid an error in this case all the relevant species and parameters will have to be declared.
Running the code above will yield the following error: `LoadError: UndeclaredSymbolicError: Unrecognized variables A detected in reaction expression: "((k1, k2), A <--> B)". Since the flag @require_declaration is declared, all species must be explicitly declared with the @species macro.`

In order to avoid the error in this case all the relevant species and parameters will have to be declared.
```@example dsl_advanced_require_dec
# The following case will not error.
t = default_t()
Expand Down

0 comments on commit 1efb96a

Please sign in to comment.