Opened 5 years ago

Last modified 5 years ago

#11318 confirmed Bug

An error should be thrown if loading resources failed

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Cc:

Description

Based on: #11315.

There are couple of scriptLoader.load usage and none check if request completed. When request failed error should be thrown, so developer knows what happened.

Change History (7)

comment:1 Changed 5 years ago by Olek Nowodziński

cc

comment:2 Changed 5 years ago by Marek Lewandowski

cc

comment:3 Changed 5 years ago by Jakub Ś

Status: newconfirmed
Version: 3.0

Problem can be reproduced from CKEditor 3.0 in both CKE 3.x and 4.x

I have however one proposition here taken from Java Frameworks. I think error is unacceptable and we should propose more user friendly approach.

In Java frameworks if some key isn't found then instead of error String is returned e.g. ???lang.somePropertyName???. Editor will load that way and developer will know that for some reason this property is simply not present.

comment:4 in reply to:  3 Changed 5 years ago by Olek Nowodziński

Replying to j.swiderski:

Problem can be reproduced from CKEditor 3.0 in both CKE 3.x and 4.x

I have however one proposition here taken from Java Frameworks. I think error is unacceptable and we should propose more user friendly approach.

In Java frameworks if some key isn't found then instead of error String is returned e.g. ???lang.somePropertyName???. Editor will load that way and developer will know that for some reason this property is simply not present.

While it may sound reasonable in Java, it doesn't make much sense for compressed JS code which is not to be debugged by developers. In my opinion it is quite convenient to log things in case of major failure and, since developer console is our only destination, we should definitely use it.

comment:5 Changed 5 years ago by Jakub Ś

My only point is that it is weird not to load whole when e.g. one label is missing. Besides examples where I came in touch with this problem is when developers were playing around (modifying, adding or removing properties) with language files.

Anyway that was just my suggestion. If you think error is better approach here I won't argue. Developer will fix it one way or another.

comment:6 Changed 5 years ago by Piotrek Koszuliński

We cannot check and handle every label, every property, every possible way of failure. It's not a heavy Java app. It has to be light and assume that what is required to work was correctly loaded and is complete. So the only thing which we can do is checking if everything is ok in most important points and throw a clear error if isn't.

comment:7 Changed 5 years ago by Jakub Ś

Throw error you say - this is where you can handle this, in catch statement. There is no need to handle every possible label but use simple approach -> catch error and return String.

Anyway you will do as you want:)

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy