Skip to content

Commit 964d0f2

Browse files
docs: replace bare except with json.JSONDecodeError in index.md example (#459)
* Update index.md replace bare except with json.JSONDecodeError in index.md example * docs: fix indentation of execute() in index.md example * docs: python indentation – 1, me – 0 (round X) * restored wording index.md I asked Copilot to fix the indentation- and they messed with your wording - it should be restored now. Hope now everything is fixed, correctly indented and finally all green.
1 parent fc4f5db commit 964d0f2

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

docs/docs/index.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,22 +142,20 @@ class DataProcessorNode(BaseNode):
142142
# Parse the input data
143143
try:
144144
data = json.loads(self.inputs.data)
145-
except:
145+
except json.JSONDecodeError as e:
146146
return self.Outputs(
147147
result="",
148-
status="error: invalid json"
148+
status=f"error: invalid json (line {e.lineno}, column {e.colno})"
149149
)
150-
150+
151151
# Process based on operation
152152
if self.inputs.operation == "transform":
153153
result = {"transformed": data, "processed": True}
154154
else:
155155
result = {"original": data, "processed": False}
156-
157-
return self.Outputs(
158-
result=json.dumps(result),
159-
status="success"
160-
)
156+
157+
return self.Outputs(result=json.dumps(result), status="success")
158+
161159

162160
# Initialize the runtime
163161
Runtime(
@@ -172,18 +170,16 @@ The runtime will automatically reload and register the updated node.
172170

173171
## Open Source Commitment
174172

175-
We believe that humanity would not have been able to achieve the level of innovation and progress we have today without the support of open source and community, we want to be a part of this movement and support the open source community. In following ways:
173+
We believe that humanity would not have been able to achieve the level of innovation and progress we have today without the support of open source and community, we want to be a part of this movement!
176174

177-
1. We will be open sourcing majority of our codebase for exosphere.host and making it available to the community. We welcome all sort of contributions and feedback from the community and will be happy to collaborate with you.
175+
1. We will be open sourcing majority of our codebase for exosphere.host and making it available to the community. We welcome all sort of contributions and feedback from the community and will be actively listening.
178176
2. For whatever the profits which we generate from exosphere.host, we will be donating a portion of it to open source projects and communities. If you have any questions, suggestions or ideas.
179177
3. We would be further collaborating with various open source student programs to provide with the support and encourage and mentor the next generation of open source contributors.
180178

181-
Please feel free to reach out to us at [nivedit@exosphere.host](mailto:nivedit@exosphere.host). Lets push the boundaries of possibilities for humanity together!
179+
Please feel free to reach out to us at [nivedit@exosphere.host](mailto:nivedit@exosphere.host). Let's push the boundaries of possibilities for humanity together!
182180

183181
## Contributing
184182

185183
We welcome community contributions. For guidelines, refer to our [CONTRIBUTING.md](https://github.com/exospherehost/exospherehost/blob/main/CONTRIBUTING.md).
186184

187185
![exosphere.host Contributors](https://contrib.rocks/image?repo=exospherehost/exospherehost)
188-
189-

0 commit comments

Comments
 (0)