There could be several issues, depending on the type of error and cable being used.
If the error is data speed related, then it could be the cable, as crappy cables may not permit the self negotiation of speed to pass at higher rates.
If the error is charging related, it could be either cable, or motherboard. Sme devices (iPad for example) require a charging port to be be able to deliver 1-2A to be recognized as charging, which is more than a normal USB port (500mA) can supply and requires a dedicated charging port. If it is a device that normally accepts 500mA for charging, AND it's plugged into a USB port on the motherboard capable of supplying that (not all can) then it could be cable related, as a higher resistivity (due to crappiness or length) cable may not permit the charging negotiation to work (requires very specific voltages on the D+/D- lines), or even if those voltages are correct, the actual cable resistance may put the delivered voltage out of the acceptable range.