# Proper Way to Set Errors?

**URL:** <https://community.transloadit.com/t/proper-way-to-set-errors/17545>\
**Category:** Uppy\
**Created:** [April 18, 2025, 2:54pm UTC](https://community.transloadit.com/t/proper-way-to-set-errors/17545 "2025-04-18T14:54:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoxter](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/shoxter/32/1359_2.png) [@shoxter](https://community.transloadit.com/u/shoxter)\
**Post date:** [April 18, 2025, 2:54pm UTC](https://community.transloadit.com/t/proper-way-to-set-errors/17545/1 "2025-04-18T14:54:11Z")

</div>

I’m currently using a custom `addUploader` function and am just curious how to trigger the Dashboard UI after the upload fn is complete. Because it doesn’t evaluate the promise result of the uploader function, I’m currently setting file properties as they are processed by the uploader.

For example, on errors:

```auto
function setFileError<M extends Meta, B extends Body>(uppy: Uppy, file: UppyFile<M, B>, error: string | null) {
	uppy.setFileState(file.id, {
		error: error
	});
}

```

And on progress:

```auto
function setFileProgress<M extends Meta, B extends Body>(uppy: Uppy, file: UppyFile<M, B>, percentage: number, startNow?: boolean) {
	uppy.setFileState(file.id, {
		progress: {
			bytesTotal: file.progress.bytesTotal,
			bytesUploaded: 0,
			uploadStarted: startNow ? Date.now() : (file.progress.uploadStarted || Date.now()),
			percentage: percentage,
			uploadComplete: Math.round(percentage) >= 100
		},
		error: null
	})
}

```

But the errors don’t show and the uploading status bar at the bottom never goes to an error state (it stays like it’s pending upload). Similarly, I’m not sure how to handle setting the file states when the upload to complete so the dashboard displays the correct UI. Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![shoxter](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/shoxter/32/1359_2.png) [@shoxter](https://community.transloadit.com/u/shoxter)\
**Post date:** [April 18, 2025, 5:07pm UTC](https://community.transloadit.com/t/proper-way-to-set-errors/17545/2 "2025-04-18T17:07:37Z")

</div>

For those who are curious, use the event emitters instead. That solved all my issues!
