Skip to content

Commit

Permalink
Merge pull request #225 from KryptonForce102/docs-fix-2
Browse files Browse the repository at this point in the history
Document attribute errors
  • Loading branch information
dphfox authored Jul 24, 2023
2 parents c1efef1 + 57526bc commit 1268e2e
Showing 1 changed file with 111 additions and 0 deletions.
111 changes: 111 additions & 0 deletions docs/api-reference/errors/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@ the details for you.
<script src="./error-paste-box.js" defer></script>


-----

<div class="fusiondoc-error-api-section" markdown>
<p class="fusiondoc-api-pills">
<span class="fusiondoc-api-pill-since">since v0.3</span>
</p>

## attributeNameNil

```
Attribute name cannot be nil.
```

This message occurs when you try to set an attribute with a 'nil' name.
This error shouldn't occur, however it is a failsafe incase something goes wrong.

```Lua
local folder = New "Configuration" {
[Attribute(nil)] = "Foo"
}
```

-----

<div class="fusiondoc-error-api-section" markdown>
Expand Down Expand Up @@ -86,6 +108,28 @@ local textBox = New "TextBox" {

-----

<div class="fusiondoc-error-api-section" markdown>
<p class="fusiondoc-api-pills">
<span class="fusiondoc-api-pill-since">since v0.3</span>
</p>

## cannotConnectAttributeChange

```
The Configuration class doesn't have an attribute called 'Foo'.
```

This message means you tried to connect to an attribute change event, however
the connection failed to register.

```Lua
-- How does an example for this work?
-- An attribute change shouldn't fail, as GetAttributeChangedSignal
-- doesn't error if the attribute doesn't exist.
```

-----

<div class="fusiondoc-error-api-section" markdown>
<p class="fusiondoc-api-pills">
<span class="fusiondoc-api-pill-since">since v0.1</span>
Expand Down Expand Up @@ -507,6 +551,29 @@ local input = New "TextBox" {

-----

<div class="fusiondoc-error-api-section" markdown>
<p class="fusiondoc-api-pills">
<span class="fusiondoc-api-pill-since">since v0.3</span>
</p>

## invalidAttributeChangeHandler

```
The change handler for the 'Ammo' attribute must be a function.
```

This message means you tried to use [AttributeChange](../instances/attributechange) on an
instance's attribute, but instead of passing a function callback, you passed
something else.

```Lua
local config = New "Configuration" {
[AttributeChange "Ammo"] = "guns"
}
```

-----

<div class="fusiondoc-error-api-section" markdown>
<p class="fusiondoc-api-pills">
<span class="fusiondoc-api-pill-since">since v0.2</span>
Expand Down Expand Up @@ -606,6 +673,29 @@ local thing = New "Part" {

-----

<div class="fusiondoc-error-api-section" markdown>
<p class="fusiondoc-api-pills">
<span class="fusiondoc-api-pill-since">since v0.3</span>
</p>

## invalidAttributeOutType

```
[AttributeOut] properties must be given Value objects.
```

This message means you tried to use [AttributeOut](../instances/attributeout), but you didn't also
give it a [value object](../state/value) to store the attributes's value inside
of.

```Lua
local config = New "Configuration" {
[AttributeChange "Ammo"] = "guns"
}
```

-----

<div class="fusiondoc-error-api-section" markdown>
<p class="fusiondoc-api-pills">
<span class="fusiondoc-api-pill-since">since v0.2</span>
Expand All @@ -632,6 +722,27 @@ local thing = New "Part" {

-----

<div class="fusiondoc-error-api-section" markdown>
<p class="fusiondoc-api-pills">
<span class="fusiondoc-api-pill-since">since v0.3</span>
</p>

## invalidAttributeOutName

```
The Configuration class doesn't have an attribute called 'Ammo'
```

This message means you tried to read an attribute of an instance using
[AttributeOut](../instances/attributeout), but the attribute can't be read. This error
shouldn't occur, however it is here for a failsafe.

```Lua
-- Once again, how does an example for this work?
```

-----

<div class="fusiondoc-error-api-section" markdown>
<p class="fusiondoc-api-pills">
<span class="fusiondoc-api-pill-since">since v0.1</span>
Expand Down

0 comments on commit 1268e2e

Please sign in to comment.